PHP code example of datingvip / utils
1. Go to this page and download the library: Download datingvip/utils library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
datingvip / utils example snippets
use DatingVIP\utils\Env;
Env::setup ([
'development' => ['/\.dev$/', '/\.test$/'], // just to display multiple regexes
'staging' => '/^dev-/',
'scary' => '/^hitchcock/',
'production' => '/\.com$/',
]);
var_dump (Env::isDevelopment ('www.mysite.dev'));
var_dump (Env::isStaging ('dev-www.mysite.com'));
var_dump (Env::isScary ('hitchcock.mysite.com')); // not production, precedence
var_dump (Env::isProduction ('www.mysite.com'));
if (Env::debug ())
{
// i can haz debug!
}
if (Env::isHTTPS ())
{
// much secure
}
if (Env::isCLI ())
{
// type type type
}