public static function load($configPath) { $files = Dir::tree($configPath, "/.php\$/"); $config = array(); if (!empty($files)) { foreach ($files as $file) { $config += (include "{$file}"); } } self::$config = $config; return $config; }
public function gc($time) { $path = $this->getPath(); $files = \ZPHP\Common\Dir::tree($path); foreach ($files as $file) { if (false !== strpos($file, 'sess_')) { if (fileatime($file) < time() - $this->gcTime) { unlink($file); } } } return true; }
public static function load($configPath) { $files = Dir::tree($configPath, "/.php\$/"); $config = array(); if (!empty($files)) { foreach ($files as $file) { $config += (include "{$file}"); } } self::$config = $config; if (Request::isLongServer()) { self::$configPath = $configPath; self::$nextCheckTime = time() + empty($config['project']['config_check_time']) ? 5 : $config['project']['config_check_time']; self::$lastModifyTime = \filectime($configPath); } return $config; }