/** * 入口函数(继承) */ public static function main($framework_enable = null, $framework_require = null, $framework_module = null, $framework_action = null, $framework_parameter = null) { // 防止运行多次 static $static_repeat = false; if ($static_repeat) { return parent::main(false); } $static_repeat = true; // 载入配置参数 list($front_action, $front_online) = self::init(array('front_action', 'front_online')); list($front_action2, $front_online2) = parent::init(array('front_action', 'front_online')); $front_action === '' and $front_action = $front_action2; $front_action === '' and $front_action = parent::init('framework_action'); $front_online === '' and $front_online = $front_online2; // 执行前端模块 $online = parent::main('final,return', null, __CLASS__, $front_action); // 执行后续模块 if ($online) { // 视图全局变量 if ($front_online) { self::view(array($front_online => $online)); } return parent::main($framework_enable, $framework_require, $framework_module, $framework_action, $framework_parameter); } else { return false; } }
* 视图全局变量 * * @param array $global */ private static function _view_variable($global = null) { $variable =& self::$view; if (!is_array($variable)) { if (empty($variable)) { $variable = array(); } else { $variable = self::_init_file($variable); if (!is_array($variable)) { $variable = array(); } } $import_config = self::_init_env('view'); if ($import_config !== array()) { $variable = array_merge($variable, $import_config); } } if (is_array($global)) { $variable = array_merge($variable, $global); } } } /** * 执行(execute) */ core::stub() and core::main();
<?php error_reporting(E_ALL ^ E_NOTICE); !defined('DS') & define('DS', DIRECTORY_SEPARATOR); define('IN_SITE', TRUE); define('SITE_ROOT', dirname(__FILE__)); define('CACHE_PATH', SITE_ROOT . DS . '.' . DS . '_cache' . DS); //缓存默认存储路径 date_default_timezone_set("PRC"); //define('IN_WAP',1); //file_put_contents('1.txt',var_export($_SERVER,true)); //echo '<pre>';print_r($_SERVER);exit(); if (!file_exists('configs/config.php')) { header("Location:install.php"); exit; } require_once 'core.php'; core::init('configs/config.php'); core::main();