JBZoo\Utils\Env::get PHP Method

get() public static method

Returns an environment variable.
public static get ( string $name, string $default = null, integer $options = self::VAR_STRING ) : mixed
$name string
$default string
$options integer
return mixed
    public static function get($name, $default = null, $options = self::VAR_STRING)
    {
        $value = getenv(trim($name));
        if ($value === false) {
            return $default;
        }
        return self::convert($value, $options);
    }

Usage Example

Example #1
0
 /**
  * @return Soap|\SoapClient
  */
 protected function _getClient()
 {
     $host = Env::get('WEB_HOST', '127.0.0.1', Env::VAR_STRING);
     $port = Env::get('WEB_PORT', '8081', Env::VAR_STRING);
     $loc = Url::create(['host' => $host, 'port' => $port, 'path' => 'wsSSMaker.asmx']);
     /** @var Soap $client */
     $client = new \SoapClient($loc . '?WSDL', ['trace' => true, 'location' => $loc]);
     return $client;
 }
All Usage Examples Of JBZoo\Utils\Env::get