Пример #1
0
 function __construct($message, $file = false)
 {
     if ($file) {
         $this->help .= " <pre>{$file}</pre>";
     }
     parent::__construct($message, "File Permissions Error");
 }
Пример #2
0
 public function handle_error()
 {
     if ($email = self::$email_on_error) {
         mail($email, self::$email_subject_on_error, $this->cli_error_message);
     }
     if ($location = self::$redirect_on_error) {
         error_log($this->cli_error_message);
         if (!self::$double_redirect) {
             self::$double_redirect = true;
             header("HTTP/1.1 500 Application Error", 1, 500);
             if (is_readable(PUBLIC_DIR . ltrim($location, "/"))) {
                 $content = file_get_contents(PUBLIC_DIR . ltrim($location, "/"));
                 ob_end_clean();
                 foreach (self::$replacements as $value => $replace) {
                     $content = str_ireplace($replace, $this->{$value}, $content);
                 }
                 echo $content;
                 exit;
             }
             $_GET["route"] = $location;
             $delegate = Inflections::slashcamelize(WaxUrl::get("controller"), true) . "Controller";
             $delegate_controller = new $delegate();
             $delegate_controller->execute_request();
             exit;
         }
     }
     header("Status: 500 Application Error");
     echo $this->error_message;
     exit;
 }
Пример #3
0
 function __construct($message, $code = "Page cannot be found", $status = "404")
 {
     if ($location = self::$redirect_on_error) {
         $this->error_heading = $code;
         $this->error_message = $this->format_trace($this);
         $this->error_site = str_ireplace("www.", '', $_SERVER['HTTP_HOST']);
         $this->error_site = substr($this->error_site, 0, strpos($this->error_site, '.'));
         $this->error_site_name = ucwords(Inflections::humanize($this->error_site));
         $this->simple_routing_error_log();
         if (!self::$double_redirect) {
             self::$double_redirect = true;
             header("HTTP/1.1 404 Not Found", 1, 404);
             if (is_readable(PUBLIC_DIR . ltrim($location, "/"))) {
                 $content = file_get_contents(PUBLIC_DIR . ltrim($location, "/"));
                 foreach (self::$replacements as $value => $replace) {
                     $content = str_ireplace($replace, $this->{$value}, $content);
                 }
                 ob_end_clean();
                 echo $content;
                 exit;
             }
             $_GET["route"] = $location;
             WaxUrl::$params = false;
             WaxUrl::perform_mappings();
             $delegate = Inflections::slashcamelize(WaxUrl::get("controller"), true) . "Controller";
             $delegate_controller = new $delegate();
             $delegate_controller->execute_request();
             exit;
         } else {
             WaxLog::log("error", "[Routing] Double redirect error");
             $code = "Application Error";
             $message = "A Page not found error was triggered and you have not set up a page to handle it";
         }
     }
     parent::__construct($message, $code);
 }
Пример #4
0
 function __construct()
 {
     parent::__construct("Bot Detected", "You did not pass the human verification test.  Sorry.");
 }
Пример #5
0
 function __construct($path)
 {
     parent::__construct("WaxBlock not found: {$path}", "");
 }
Пример #6
0
 function __construct($type)
 {
     parent::__construct("No ID Specified", "You must specify an ID to view {$type}");
 }
Пример #7
0
 function __construct($errinfo)
 {
     parent::__construct("Database Error ({$errinfo['1']})", $errinfo[2] . "<hr /><pre>" . print_r($errinfo, true) . "</pre>");
 }
Пример #8
0
 function __construct($viewfile)
 {
     parent::__construct("View Not Found", "The view '{$viewfile}' could not be located");
 }
Пример #9
0
 function __construct($attr_data, $action)
 {
     parent::__construct("{$attr_data['type']} is not a valid attribute data type", "The {$attr_data['type']} attribute type could not be found");
 }
Пример #10
0
 function __construct($message, $help = "")
 {
     $this->help .= "<pre>" . $help . "</pre>";
     parent::__construct($message, "Email Send Error");
 }
Пример #11
0
 function __construct($user, $resource)
 {
     parent::__construct("Unauthorized", "You do not have access to {$resource} with credentials:<pre>" . print_r($user, true) . "</pre>");
 }
Пример #12
0
 function __construct($type)
 {
     parent::__construct("Error with Type", "`{$type}` is not a valid data type.");
 }
Пример #13
0
<?php

/******* production.php runs commands only in production environment */
/************ Log Levels *****************************/
Config::set("log_info", false);
Config::set("log_warn", false);
Config::set("log_error", true);
/************ Application Error Handling *******************************************************
*
*  When you're running in production mode, you don't want your errors displayed to users.
*  The following commands can be uncommented to handle errors professionally.
*  Firstly the routing redirect_on_error gives a location for a 404 error (page not found)
*  The second redirect_on_error is an application error page.
*  Both of these can be either actions in your application or static pages.
*  
*  Finally email_on_error accepts an email address and email_subject_on_error a text subject.
*  If these are set a copy of the error trace will be emailed to the address. 
*/
WXRoutingException::$redirect_on_error = "/404.html";
// Page not found error
// Application Error and an email address and subject to send details to.
WaxException::$redirect_on_error = "/error.html";
//WaxException::$email_on_error="";
//WaxException::$email_subject_on_error="";
/*********************************************************************************************/
/*********************************************************************************************/
/*********** Your Additional Application Configuration ***************************************
*  This file is run at boot time so if you want to set any systemwide configuration values, 
*  you can do so below this point 
*/
Пример #14
0
 function __construct($message, $code = "Missing File Dependency")
 {
     parent::__construct($message, $code);
 }
Пример #15
0
 function __construct()
 {
     parent::__construct("Password cannot be blank", "The password you supplied was blank");
 }
Пример #16
0
 function __construct($uname)
 {
     parent::__construct("Invalid Username/Password", "Your username and/or password was incorrect.");
 }
Пример #17
0
 function __construct($controller)
 {
     parent::__construct("Invalid ControllerCtx", "{$controller} should inherit ControllerCtx");
 }
Пример #18
0
 function __construct($objname)
 {
     parent::__construct("Not Found: {$objname}", "Object: {$objname} could not be created");
 }
Пример #19
0
 function __construct($hf)
 {
     parent::__construct("Unknown Hash Function: {$hf}", "{$hf} is not a valid hash function");
 }
Пример #20
0
 function __construct($message, $code = "Application Error")
 {
     parent::__construct($message, $code);
 }