Example #1
0
 /**
  * Takes an array and wraps it inside an object.  If $strict is not set to
  * FALSE, the original array will be destroyed, and the data can only be
  * accessed via the object's accessor methods
  *
  * @param array $source
  * @param string $conf_file
  * @param string $conf_section
  * @param boolean $strict
  * @return Inspekt_Cage
  *
  * @static
  */
 function Factory(&$source, $conf_file = NULL, $conf_section = NULL, $strict = TRUE)
 {
     if (!is_array($source)) {
         user_error('$source ' . $source . ' is not an array', E_USER_NOTICE);
     }
     $cage = new Inspekt_Cage();
     $cage->_setSource($source);
     $cage->_parseAndApplyAutoFilters($conf_file, $conf_section);
     if ($strict) {
         $source = NULL;
     }
     return $cage;
 }
 /**
  * Takes an array and wraps it inside an object.  If $strict is not set to
  * FALSE, the original array will be destroyed, and the data can only be
  * accessed via the object's accessor methods
  *
  * @param array $source
  * @param string $conf_file
  * @param string $conf_section
  * @param boolean $strict
  * @return Inspekt_Cage
  *
  * @static
  */
 public static function Factory(&$source, $conf_file = NULL, $conf_section = NULL, $strict = TRUE)
 {
     if (!is_array($source)) {
         Inspekt_Error::raiseError('$source ' . $source . ' is not an array', E_USER_WARNING);
     }
     $cage = new Inspekt_Cage();
     $cage->_setSource($source);
     $cage->_parseAndApplyAutoFilters($conf_file, $conf_section);
     if ($strict) {
         $source = NULL;
     }
     return $cage;
 }