示例#1
0
文件: Config.php 项目: xifat/zphp
 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;
 }
示例#2
0
文件: File.php 项目: phpdn/zphp
 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;
 }
示例#3
0
 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;
 }