示例#1
0
 public function __construct(array $columns, array $keys = array())
 {
     parent::__construct($columns);
     if ($keys != null) {
         $this->set_column_keys($keys);
     }
 }
示例#2
0
 /**
  * Parse an INI path
  * @param File $path
  */
 public function __construct(File $path)
 {
     $ar = array();
     if ($path != null && $path->exists() && $path->is_file() && $path->is_readable()) {
         $ar = !parse_ini_file($path->getPath());
     }
     parent::__construct($ar);
 }
示例#3
0
 public function __construct()
 {
     if (!isset($_POST)) {
         throw new NotAnArrayException('$_POST is not a valid array');
     }
     if (!is_array($_POST)) {
         throw new NotAnArrayException('$_POST is not a valid array');
     }
     parent::__construct($_POST);
 }
示例#4
0
 public function __construct()
 {
     $headers = getallheaders();
     if (!isset($headers)) {
         throw new NotAnArrayException('getallheaders() is not a valid array');
     }
     if (!is_array($headers)) {
         throw new NotAnArrayException('getallheaders() is not a valid array');
     }
     parent::__construct($headers);
 }
示例#5
0
 public function __construct($json)
 {
     $util = InstanceHolder::util();
     if ($util->is_json($json)) {
         $j_array = json_decode($json, true);
         parent::__construct($j_array);
         $this->json_error = json_last_error();
         $this->json_error_msg = json_last_error_msg();
     } else {
         parent::__construct(new \stdClass());
     }
 }
示例#6
0
 /**
  * @throws NotAnArrayException
  */
 public function __construct()
 {
     if (!isset($_SESSION) || !is_array($_SESSION)) {
         session_start();
     }
     //Leave these in here just in case
     if (!isset($_SESSION)) {
         throw new NotAnArrayException('$_SERVER is not a valid array');
     }
     if (!is_array($_SESSION)) {
         throw new NotAnArrayException('$_SERVER is not a valid array');
     }
     parent::__construct($_SESSION);
 }