示例#1
0
文件: Arr.php 项目: colibri-fw/util
 /**
  * @param array  $array
  * @param string $dottedKey
  *
  * @return mixed|null
  */
 public static function remove(array &$array, $dottedKey)
 {
     if (isset($array[$dottedKey])) {
         $value = $array[$dottedKey];
         unset($array[$dottedKey]);
         return $value;
     }
     $k = explode('.', $dottedKey, 2);
     return isset($k[1]) ? Arr::remove($array[$k[0]], $k[1]) : null;
 }
示例#2
0
 /**
  * @param string $dottedKey
  * @param mixed  $default
  *
  * @return mixed
  */
 public static function get($dottedKey, $default = null)
 {
     if (self::$flashedVars) {
         $flashedValue = Arr::get(self::$flashedVars, $dottedKey, '~no~flashed~value~');
         if ($flashedValue !== '~no~flashed~value~') {
             return $flashedValue;
         }
     }
     return self::$storage->get($dottedKey, $default);
 }
示例#3
0
 public static function __callStatic($name, $arguments)
 {
     $key = isset($arguments[0]) ? $arguments[0] : null;
     $default = isset($arguments[1]) ? $arguments[1] : null;
     return Arr::get(static::get($name), $key, $default);
 }
示例#4
0
 private static function getConfig()
 {
     $config = Config::getOrEmpty('cache');
     return Arr::overwrite(static::$defaultConfig, isset($config['memcache']) ? $config['memcache'] : []);
 }
示例#5
0
文件: Log.php 项目: colibri-fw/log
 private static function loadFromConfig()
 {
     static::$config = Arr::overwrite(static::$defaultConfig, Config::getOrEmpty('log'));
     static::$config['folder'] = rtrim(static::$config['folder'], '/\\ ');
     return static::$config;
 }
示例#6
0
 /**
  * @param string $dottedKey
  *
  * @return mixed|null
  */
 public function remove($dottedKey)
 {
     return Arr::remove($_SESSION, $dottedKey);
 }