Authored by 周少峰

rm error

1 -<?php  
2 -  
3 -namespace WebPlugin;  
4 -  
5 -/**  
6 - * 辅助类  
7 - */  
8 -class TriggerError  
9 -{  
10 - public static function myErrorHandler($errno, $errstr, $errfile, $errline)  
11 - {  
12 - switch ($errno) {  
13 - case \Yaf\ERR\NOTFOUD\CONTROLLER:  
14 - case \Yaf\ERR\NOTFOUD\MODULE:  
15 - case \Yaf\ERR\NOTFOUD\ACTION:  
16 - header("Not Found");  
17 - break;  
18 -  
19 - default:  
20 - echo 'ehre';  
21 - echo "Unknown error type: [$errno] $errstr<br />\n";  
22 - break;  
23 - }  
24 - return true;  
25 - }  
26 -}  
@@ -149,28 +149,6 @@ class Bootstrap extends Bootstrap_Abstract @@ -149,28 +149,6 @@ class Bootstrap extends Bootstrap_Abstract
149 //} 149 //}
150 } 150 }
151 151
152 - public function _initError(Dispatcher $dispatcher)  
153 - {  
154 - $dispatcher->getInstance()->setErrorHandler(array($this,"myErrorHandler"));  
155 -// $dispatcher->getInstance()->setErrorHandler(array("\\WebPlugin\\TriggerError","myErrorHandler"));  
156 - }  
157 -  
158 - public static function myErrorHandler($errno, $errstr, $errfile, $errline)  
159 - {  
160 - switch ($errno) {  
161 - case YAF_ERR_NOTFOUND_CONTROLLER:  
162 - case YAF_ERR_NOTFOUND_MODULE:  
163 - case YAF_ERR_NOTFOUND_ACTION:  
164 - header("Not Found");  
165 - break;  
166 -  
167 - default:  
168 - echo "Unknown error type: [$errno] $errstr<br />\n";  
169 - break;  
170 - }  
171 -  
172 - return true;  
173 - }  
174 // /** 152 // /**
175 // * 初始化第三方包 153 // * 初始化第三方包
176 // * @param Dispatcher $dispatcher 154 // * @param Dispatcher $dispatcher