$v) { self::assign($v . $path, $index); } if($file != $index) { self::$global[$file] = self::$global[$index]; } } return self::$global[$index]; } /** * object * @param string $file * * @var array */ static private function object($file, $project = '', $path = 'config') { if($project) { $index = $project . '_' . $path . '_' . $file; } else { $index = $file; } if(isset(self::$object[$index])) { return self::$object[$index]; } self::$object[$index] = (object) self::$global[$index]; if($file != $index) { self::$object[$file] = self::$object[$index]; } return self::$object[$index]; } /** * file * @param string $file * @param string $path * * @var array */ static private function file($file, &$path) { $path .= '/'; if($file == 'host' || $file == 'database' || $file == 'debug') { $path .= $_SERVER['MAZEPHP_SERVER'] . '/'; } $path .= $file . '.php'; } /** * assign * @param string $file * * @var array */ static private function assign($file, $index) { if(is_file($file)) { $config = include($file); if(is_array($config)) { self::$global[$index] = array_merge(self::$global[$index], $config); } } } }