Inspekt\Inspekt::makeEnvCage PHP Метод

makeEnvCage() публичный статический Метод

This utilizes a singleton pattern to get around scoping issues
public static makeEnvCage ( string $config_file = null, boolean $strict = true ) : Cage
$config_file string
$strict boolean whether or not to nullify the superglobal array
Результат Cage
    public static function makeEnvCage($config_file = null, $strict = true)
    {
        /**
         * @staticvar $_instance
         */
        static $_instance;
        if (!isset($_instance)) {
            $_instance = Cage::factory($_ENV, $config_file, '_ENV', $strict);
        }
        $GLOBALS['HTTP_ENV_VARS'] = null;
        return $_instance;
    }

Usage Example

Пример #1
0
 /**
  *
  */
 public function testMakeEnvCage()
 {
     $cage = Inspekt::makeEnvCage();
     $this->assertTrue($cage instanceof Cage);
 }