Esempio n. 1
0
 /**
  * @param null $path
  * @param null $default
  *
  * @return array|mixed
  */
 static final function config($path = NULL, $default = NULL)
 {
     if (!static::$_config) {
         static::$_config = Kohana::$config->load('restfulapi')->as_array();
     }
     return NULL !== $path ? Kohana_Arr::path(static::$_config, $path, $default) : static::$_config;
 }
Esempio n. 2
0
 protected static function config($path, $default = NULL, $delimeter = NULL)
 {
     if (!isset(static::$_configData)) {
         static::$_configData = Kohana::$config->load(static::$_configKey)->as_array();
     }
     return Kohana_Arr::path(static::$_configData, $path, $default, $delimeter);
 }
Esempio n. 3
0
 /**
  * @param null|string|array $key
  * @param null              $default
  * @param null              $delimiter
  *
  * @return array|mixed
  */
 protected function requestData($key = NULL, $default = NULL, $delimiter = NULL)
 {
     if (NULL === $this->_requestData) {
         $this->_requestData = Helpers_Arr::merge($this->request->query(), $this->request->post(), $this->_parse_request_body());
     }
     if (Kohana_Arr::is_array($key)) {
         $result = [];
         foreach ($key as $idx => $value) {
             if (!Valid::digit($idx)) {
                 $_key = $idx;
                 $_default = $value;
             } else {
                 $_key = $value;
                 $_default = $default;
             }
             $result[$_key] = Kohana_Arr::path($this->requestData(), $_key, $_default, $delimiter);
         }
     } else {
         $result = NULL === $key ? $this->_requestData : Kohana_Arr::path($this->requestData(), $key, $default, $delimiter);
     }
     return $result;
 }