Inspekt\Inspekt::makeFilesCage PHP Method

makeFilesCage() public static method

This utilizes a singleton pattern to get around scoping issues
public static makeFilesCage ( string $config_file = null, boolean $strict = true ) : Cage
$config_file string
$strict boolean whether or not to nullify the superglobal array
return Cage
    public static function makeFilesCage($config_file = null, $strict = true)
    {
        /**
         * @staticvar $_instance
         */
        static $_instance;
        if (!isset($_instance)) {
            $_instance = Cage::factory($_FILES, $config_file, '_FILES', $strict);
        }
        $GLOBALS['HTTP_POST_FILES'] = null;
        return $_instance;
    }

Usage Example

Beispiel #1
0
 /**
  *
  */
 public function testMakeFilesCage()
 {
     $cage = Inspekt::makeFilesCage();
     $this->assertTrue($cage instanceof Cage);
 }