yd12300云顶线路_Welcome

系统出现异常

异常位置: FILE:/usr/home/hmu248129/htdocs/coolphp/app.php LINE:6

[ 提示信息 ]

控制器[__media__]不存在!

[ 详情 ]

请求网址:/index.php
4: */
5:
6: class App extends Base { public $view; public $controller; public $response; public $controllerName; public $actionName; public $format = 'html'; public $viewName; public function __construct($config=null) { g('__app',$this); if(!empty($config)){ if(is_array($config)){ c($config); }else{ if(file_exists(APP_PATH.DS.c('config_dir').DS.$config.'.php')){ $setting = include(APP_PATH.DS.c('config_dir').DS.$config.'.php'); c($setting); } } } $this->init(); } public function init(){ set_error_handler( array('App',"appError") ); set_exception_handler( array('App',"appException") ); $timeZone = c('time_zone'); if (function_exists('date_default_timezone_set') && $timeZone) { date_default_timezone_set( $timeZone ); } $this->checkLanguage(); if ( c('session_start') ) { $this->session = Session::getInstance(); } } public function checkLanguage(){ if (c('language_switch_on')) { $langVar = "lang"; $lang = $this->getRequest($langVar,c('language')); if (!empty($lang)) { }elseif( $lang = $this->cookie($langVar) ){ }elseif( $serverLang = $this->server('HTTP_ACCEPT_LANGUAGE') ){ preg_match('/^([a-z\-]+)/i', $serverLang, $matches); if($matches[1]) $lang = $matches[1]; } if(!empty($lang)){ c('language', $lang); Cookie :: set($langVar, $lang, time() + 3600*24*365); } } return true; } public function run(){ try { $this->doPreFilter(); $this->controllerName = $this->getController(); $this->actionName = $this->getAction(); $this->format = $this->getResponseFormat(); if($this->_beforeRun()){ $GLOBALS['_startTime'] = microtime(TRUE); $this->controller = Controller::loadController( $this->controllerName ); $this->controller->exec( $this->actionName ); $GLOBALS['_execTime'] = microtime(TRUE); $this->view = View::loadView(); $template = $this->getViewName(); $result = $this->controller->result; $this->response = $this->view->display($template,$result); } $this->_afterRun(); $this->doAfterFilter(); $GLOBALS['_endTime'] = microtime(TRUE); $this->doLog(); }catch(Exception $ex){ $this->appException($ex); } return $this->response; } public function doPreFilter(){ $filters = c('pre_filter'); if (is_string($filters)) $filters = explode( ',', $filters ); $this->doFilter($filters); } public function doAfterFilter(){ $filters = c('after_filter'); if (is_string($filters)) $filters = explode(',', $filters); $this->doFilter($filters); } public static function appError($errno, $errstr, $errfile, $errline) { switch ($errno) { case E_ERROR : case E_USER_ERROR : $errorStr = "Error:[$errno] $errstr " . basename($errfile) . " at $errline row.\n"; Loger::log($errorStr, Loger :: ERROR); $title = __('system._errro_'); $errors = array ( 'file' => basename($errfile), 'line' => $errline, 'message' => $errstr, 'type' => $errno ); exit ( $GLOBALS['__app']->showError($title, $errors) ); break; case E_STRICT : case E_USER_WARNING : case E_USER_NOTICE : default : $errorStr = "Notice:[$errno] $errstr " . basename($errfile) . " at $errline row.\n"; Loger::log($errorStr, Loger :: NOTICE); break; } } public static function appException($exception) { $errors = CLException :: getException($exception); $title = __('system._exception_'); exit( $GLOBALS['__app']->showError($title, $errors) ); } public function showError($title, $error) { $result = 'System error:
'.$title."
:".$error['message']; $file = 'exception'; $file = $this->format == 'html' ? $file : $file.'_'.$this->format; if( file_exists(SYS_PATH.DS.'view'.DS. $file . EXT) ){ ob_start(); include(SYS_PATH.DS.'view'.DS. $file . EXT); $result = ob_get_contents(); ob_end_clean(); } header("HTTP/1.0 533 COOLPHP ERROR"); header("Status: 533 COOLPHP ERROR"); return $result; } public function getController(){ return $this->getRequest(c('var_controller'),c('default_controller') ); } public function getAction(){ return $this->getRequest(c('var_action'), c('default_action')); } public function getResponseFormat(){ return $this->getRequest(c('var_format'), c('default_format')); } public function getViewName(){ if(!$this->viewName){ $template = $this->controllerName . '/' . $this->actionName; $_template = $this->getRequest(c('var_template'),null); if(!empty($_template)){ $template = $_template; }elseif(!empty($this->controller->view)){ $template = $this->controller->view; } if ($this->format != 'html') { $template = $template . '_' . $this->format; } $this->viewName = strtolower($template); } return $this->viewName; } public function getRequest($parameter = null, $default = null) { $var = $default; if (empty ($parameter)){ $var = array_merge($_GET, $_POST); }elseif(isset ($_GET[$parameter])){ $var = $_GET[$parameter]; }elseif( isset ($_POST[$parameter]) ){ $var = $_POST[$parameter]; } return $var; } function get($parameter = null, $default = null) { if (is_null($parameter)) return $_GET; return isset ($_GET[$parameter]) ? $_GET[$parameter] : $default; } function post($parameter = null, $default = null) { if (is_null($parameter)) return $_POST; return isset ($_POST[$parameter]) ? $_POST[$parameter] : $default; } function cookie($parameter = null, $default = null) { if (is_null($parameter)) return $_COOKIE; return isset ($_COOKIE[$parameter]) ? $_COOKIE[$parameter] : $default; } function session($parameter = null, $default = null) { if (is_null($parameter)) return $_SESSION; return isset ($_SESSION[$parameter]) ? $_SESSION[$parameter] : $default; } function server($parameter = null, $default = null) { if (is_null($parameter)) return $_SERVER; return isset ($_SERVER[$parameter]) ? $_SERVER[$parameter] : $default; } function requestMethod() { return strtolower($_SERVER['REQUEST_METHOD']); } function env($parameter = null, $default = null) { if (is_null($parameter)) return $_ENV; return isset ($_ENV[$parameter]) ? $_ENV[$parameter] : $default; } protected function _beforeRun(){ $pageCacheExpire = c('page_cache_expire'); if(c('page_cache_expire')>0){ $cacheId = $this->getPageCacheKey(); $pageExpire = $this->getCacheExpire(); if ($pageExpire!==false && ( $cache = Cache :: getInstance())){ $pageExpire = $pageExpire ? intval($pageExpire) : $pageCacheExpire; if($pageExpire>0){ $result = $cache->get($cacheId); if($result!==false){ $this->response = $result; return false; } } } } return true; } protected function _afterRun(){ $pageCacheExpire = c('page_cache_expire'); if(c('page_cache_expire')>0){ $cacheId = $this->getPageCacheKey(); $pageExpire = $this->getCacheExpire(); $cache = Cache :: getInstance(); if ($pageExpire!==false && $cache){ $pageExpire = $pageExpire ? intval($pageExpire) : $pageCacheExpire; $cache->set( $cacheId,$this->response,$pageExpire ); } } return true; } protected function getCacheExpire() { $pageCacheExpire = 0; if (file_exists(APP_PATH . DS . 'config' . DS . 'cache' . EXT)) { $cacheConfig = include (APP_PATH . DS . 'config' . DS . 'cache' . EXT); if (isset ($cacheConfig[$this->controllerName])) { $configVal = $cacheConfig[$this->controllerName]; if (is_array($configVal)) { $pageCacheExpire = isset ($configVal[$this->actionName]) ? $configVal[$this->actionName] : 0; } else { $pageCacheExpire = intval($configVal); } } } return $pageCacheExpire; } protected function getPageCacheKey(){ return unid(array ( 'controller' => $this->controllerName, 'action' => $this->actionName, 'format' => $this->format, 'request' => $this->getRequest() )); } protected function doFilter($filters) { if (empty ($filters)) return; static $caFilters = array (); foreach ($filters as $filter) { if (empty ($filter)) continue; $object = null; if (isset ($caFilters[$filter])) { $object = $caFilters[$filter]; }elseif(class_exists( $filter )){ $object = new $filter(); $caFilters[$filter] = $object; }else{ throw new CLException('ClassNotFound',$filter); } $object->doFilter($this); } } protected function doLog() { $initTime = number_format(($GLOBALS['_startTime'] - $GLOBALS['_initTime']), 3); $execTime = number_format(($GLOBALS['_execTime'] - $GLOBALS['_startTime']), 3); $templateTime = number_format(($GLOBALS['_endTime'] - $GLOBALS['_execTime']), 3); $totalTime = number_format(($GLOBALS['_endTime'] - $GLOBALS['_initTime']), 3); $str = 'Process: %ss ( Load:0.0s Init:%ss Exec:%ss Template:%ss )'; Loger::log(sprintf($str, $totalTime, $initTime, $execTime, $templateTime), Loger::LOG); } public function __destruct() { $this->controller = null; $this->view = null; } } ?>
7:8:

CoolPHP1.0 { 欢迎使用CoolPHP MVC开发架构 } -- [ It being cool... ]
XML 地图 | Sitemap 地图