Exemple #1
0
 /**
  * Enter description here...
  *
  * @see Inspekt_Supercage::Factory()
  * @param string  $config_file
  * @param boolean $strict
  */
 function _makeCages($config_file = NULL, $strict = TRUE)
 {
     $this->get = Inspekt::makeGetCage($config_file, $strict);
     $this->post = Inspekt::makePostCage($config_file, $strict);
     $this->cookie = Inspekt::makeCookieCage($config_file, $strict);
     $this->env = Inspekt::makeEnvCage($config_file, $strict);
     $this->files = Inspekt::makeFilesCage($config_file, $strict);
     // $this->session	= Inspekt::makeSessionCage($config_file, $strict);
     $this->server = Inspekt::makeServerCage($config_file, $strict);
 }
 /**
  * Enter description here...
  *
  * @see Inspekt\Supercage::Factory()
  * @param string $config_file
  * @param boolean $strict
  */
 protected function makeCages($config_file = null, $strict = true)
 {
     $this->get = Inspekt::makeGetCage($config_file, $strict);
     $this->post = Inspekt::makePostCage($config_file, $strict);
     $this->cookie = Inspekt::makeCookieCage($config_file, $strict);
     $this->env = Inspekt::makeEnvCage($config_file, $strict);
     $this->files = Inspekt::makeFilesCage($config_file, $strict);
     $this->server = Inspekt::makeServerCage($config_file, $strict);
 }
Exemple #3
0
 /**
  * Enter description here...
  *
  * @see Inspekt_Supercage::Factory()
  * @param boolean $strict
  */
 function _makeCages($strict = TRUE)
 {
     $this->get = Inspekt::makeGetCage($strict);
     $this->post = Inspekt::makePostCage($strict);
     $this->cookie = Inspekt::makeCookieCage($strict);
     $this->env = Inspekt::makeEnvCage($strict);
     $this->files = Inspekt::makeFilesCage($strict);
     /**
      * Don't put session in cage as it will nullify $_SESSION and we will loose the session completely.
      * TODO: Find a way to put the session data in cage and still retain the session correctly
      */
     //$this->session= Inspekt::makeSessionCage($strict);
     $this->server = Inspekt::makeServerCage($strict);
 }
 /**
  * 
  */
 public function testMakeServerCage()
 {
     $cage = Inspekt::makeServerCage();
     $this->assertTrue($cage instanceof Inspekt_Cage);
 }
<?php

/**
 * Demonstration of:
 * - helper "make*Cage()" methods to create input cage from superglobal
 * - cleanup of HTTP_*_VARS
 * - cage filter methods
 * - "Array Query" method of accessing deep keys in multidim arrays
 */
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(dirname(__FILE__)));
require_once 'Inspekt.php';
//echo "<pre>"; echo var_dump($_SERVER); echo "</pre>\n";
$serverCage = Inspekt::makeServerCage();
echo "<pre>";
echo var_dump($serverCage);
echo "</pre>\n";
echo 'Digits:' . $serverCage->getDigits('SERVER_SOFTWARE') . '<p/>';
echo 'Alpha:' . $serverCage->getAlpha('SERVER_SOFTWARE') . '<p/>';
echo 'Alnum:' . $serverCage->getAlnum('SERVER_SOFTWARE') . '<p/>';
echo 'Raw:' . $serverCage->getRaw('SERVER_SOFTWARE') . '<p/>';
echo '<pre>$_SERVER:';
echo var_dump($_SERVER);
echo "</pre>\n";
echo '<pre>HTTP_SERVER_VARS:';
echo var_dump($HTTP_SERVER_VARS);
echo "</pre>\n";
var_dump($serverCage->getAlnum('/argv/0'));