/** * @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; }
/** * @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); }
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); }
private static function getConfig() { $config = Config::getOrEmpty('cache'); return Arr::overwrite(static::$defaultConfig, isset($config['memcache']) ? $config['memcache'] : []); }
private static function loadFromConfig() { static::$config = Arr::overwrite(static::$defaultConfig, Config::getOrEmpty('log')); static::$config['folder'] = rtrim(static::$config['folder'], '/\\ '); return static::$config; }
/** * @param string $dottedKey * * @return mixed|null */ public function remove($dottedKey) { return Arr::remove($_SESSION, $dottedKey); }