Ejemplo n.º 1
0
 function __construct($method, $messages)
 {
     $this->controller = new AppController();
     $params = Router::getParams();
     $viewPath = $this->controller->viewPath;
     if (Configure::read('App.theme')) {
         $viewPath = 'errors';
         if ($this->controller->view == 'Theme') {
             $viewPath = 'themed' . DS . Configure::read('App.theme') . DS . 'errors';
         }
     }
     if (Configure::read('debug') == 0) {
         $method = 'error404';
     }
     $checkView = VIEWS . $viewPath . DS . Inflector::underscore($method) . '.ctp';
     if (file_exists($checkView)) {
         $this->controller->_set(Router::getPaths());
         $this->controller->viewPath = $viewPath;
         $this->controller->theme = $appConfigurations['theme'];
         $this->controller->pageTitle = __('Error', true);
         $this->controller->set('message', $messages[0]['url']);
         $this->controller->set('appConfigurations', $appConfigurations);
         $this->controller->render($method);
         e($this->controller->output);
     } else {
         parent::__construct($method, $messages);
     }
 }
Ejemplo n.º 2
0
 /**
  * Class constructor.
  *
  * @param string $method Method producing the error
  * @param array $messages Error messages
  */
 function __construct($method, $messages)
 {
     $this->_requested = !SL::getInstance()->main;
     // Make a more user-friendly "No Database Connection"
     if ($method === 'missingTable') {
         $db = @ConnectionManager::getDataSource('default');
         if (!$db->isConnected()) {
             $method = 'dbConnectionError';
         }
     }
     parent::__construct($method, $messages);
 }
Ejemplo n.º 3
0
 /**
  * 
  */
 function __construct($method, $messages)
 {
     $params = Router::getParams();
     if (($method == 'missingController' || $method == 'missingAction') && file_exists(VIEWS . DS . 'static' . DS . $params['controller'] . ".ctp")) {
         $this->controller =& new AppController();
         $this->controller->_set(Router::getPaths());
         $this->controller->params = $params;
         $this->controller->constructClasses();
         $this->controller->beforeFilter();
         $this->controller->viewPath = 'static';
         $this->controller->render($params['controller']);
         e($this->controller->output);
         exit;
     }
     parent::__construct($method, $messages);
     exit;
 }
Ejemplo n.º 4
0
 function __construct($method, $messages)
 {
     //Configure::write('debug', 1);
     //      $message = 'Site '.env('SERVER_NAME').' has generated an error message'."<BR>";
     //              $message .= "Error Type: $method<BR>";
     //               foreach ($messages[0] as $key => $value) {
     //                   $message .= str_pad($key, 10).": $value<BR>";
     //               }
     //               $message .= 'URL  : '.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']."<BR>";
     //               $message .= 'User Agent  : '.$_SERVER['HTTP_USER_AGENT']."<BR>";
     //               $message .= 'Referrer  : '.env('HTTP_REFERER')."<BR>";
     //               $message .= 'Remote add: '.env('REMOTE_ADDR')."<BR>";
     //
     //       App::import('Vendor', 'PHPMailer', array('file' => 'mailer.class.php'));
     //  		 $mailer = new PHPMailer();
     //  		 $mailer->From = 'error@localhost';
     //  		 $mailer->AddAddress(DEVELOPER_EMAIL, DEVELOPER_EMAIL);
     //  		 $mailer->Subject = "Error in Bpong application!";
     //  		 $mailer->Body    = $message;
     //           $mailer->Send();
     parent::__construct($method, $messages);
 }
Ejemplo n.º 5
0
 function __construct($error)
 {
     parent::__construct($error);
 }
Ejemplo n.º 6
0
	/**
	 * 
	 * @param 
	 * @return 
	 * 
	*/
	function __construct($method, $messages) {
		Configure::write('debug', 1);
		parent::__construct($method, $messages);
	}
 /**
  * Overload constructor so we can test it properly
  */
 function __construct($method, $messages, $test = false)
 {
     if (!$test) {
         parent::__construct($method, $messages);
     }
 }