当前位置: 首页>>代码示例>>PHP>>正文


PHP add::include_include_file方法代码示例

本文整理汇总了PHP中add::include_include_file方法的典型用法代码示例。如果您正苦于以下问题:PHP add::include_include_file方法的具体用法?PHP add::include_include_file怎么用?PHP add::include_include_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在add的用法示例。


在下文中一共展示了add::include_include_file方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handle_exception

 /**
  * handle_exception()
  * The error handler for exceptions
  * @param Exception $e the exception to handle
  * @since ADD MVC 0.0
  */
 static function handle_exception(Exception $e)
 {
     try {
         try {
             if (method_exists($e, 'handle_exception')) {
                 return $e->handle_exception();
             } else {
                 throw new Exception("Non e_add exception sub class or no handle_exception() function found for exception");
             }
         } catch (Exception $e2) {
             while (ob_get_level()) {
                 ob_end_clean();
             }
             if ($e instanceof SmartyException) {
                 static::handle_exception(new e_smarty($e->getMessage(), $e));
             }
             if (add::content_type() == 'text/plain') {
                 die(get_class($e) . "(#" . $e->getCode() . ")\r\n\r\n" . $e->getMessage() . "\r\n\r\n" . $e->getFile() . ":" . $e->getLine() . "\r\n\r\n\r\n\r\n");
             } else {
                 DEFINE('add\\terminal_error\\error_message', $e->getMessage());
                 DEFINE('add\\terminal_error\\error_header', get_class($e));
                 DEFINE('add\\terminal_error\\error_footer', $e->getFile() . ":" . $e->getLine());
                 if (!headers_sent() && !add::include_include_file('terminal_error.php')) {
                     throw new Exception("Failed to display terminal error");
                 }
                 add::shutdown(false);
             }
         }
     } catch (Exception $e3) {
         $e1_string = "<div style='color:red'>" . get_class($e) . "(#" . $e->getCode() . ")" . $e->getMessage() . "\r\n" . $e->getFile() . ":" . $e->getLine() . "</div>";
         echo $e1_string;
         $e3_string = "<div style='color:red'>" . get_class($e3) . "(#" . $e3->getCode() . ")" . $e3->getMessage() . "\r\n" . $e3->getFile() . ":" . $e3->getLine() . "</div>";
         if ($e3_string != $e1_string) {
             echo $e3_string;
         }
         debug::var_dump($e3->getTraceAsString());
         die;
     }
 }
开发者ID:google-code-backups,项目名称:add-mvc-framework,代码行数:45,代码来源:add.class.php

示例2: handle_exception

 /**
  * handle_exception()
  * The error handler for exceptions
  * @param Exception $e the exception to handle
  * @since ADD MVC 0.0
  */
 static function handle_exception(Exception $e)
 {
     try {
         while (ob_get_level()) {
             # Do not echo this, it is a big security risk
             ob_get_clean();
         }
         try {
             if (method_exists($e, 'handle_exception')) {
                 return $e->handle_exception();
             } else {
                 throw new Exception("Non e_add exception sub class or no handle_exception() function found for exception");
             }
         } catch (Exception $e2) {
             if ($e instanceof SmartyException) {
                 static::handle_exception(new e_smarty($e->getMessage(), array('message' => $e->getMessage(), 'code' => $e->getCode(), 'trace' => str_replace(array(add::config()->root_dir, add::config()->add_dir), array('*root_dir*', '*add_dir*'), $e->getTraceAsString()))));
             }
             if (add::content_type() == 'text/plain') {
                 die(get_class($e) . "(#" . $e->getCode() . ")\r\n\r\n" . $e->getMessage() . "\r\n\r\n" . $e->getFile() . ":" . $e->getLine() . "\r\n\r\n\r\n\r\n");
             } else {
                 if (add::is_developer()) {
                     DEFINE('add\\terminal_error\\error_message', $e->getMessage());
                     DEFINE('add\\terminal_error\\error_trace', $e->getTraceAsString());
                     DEFINE('add\\terminal_error\\error_header', get_class($e));
                     DEFINE('add\\terminal_error\\error_footer', $e->getFile() . ":" . $e->getLine());
                 } else {
                     $debug_mail_to = add::config()->developer_emails;
                     if (is_array($debug_mail_to) || is_object($debug_mail_to)) {
                         $debug_mail_to = implode(",", (array) $debug_mail_to);
                     }
                     mail($debug_mail_to, "Terminal Error: " . $e->getMessage(), $e->getTraceAsString());
                     DEFINE('add\\terminal_error\\error_message', 'An error occured<br />please contact the system administrators or go back to <a href="' . add::config()->path . '">Home</a>');
                     DEFINE('add\\terminal_error\\error_header', 'Warning!');
                     DEFINE('add\\terminal_error\\error_footer', 'Please contact the system administrators');
                     DEFINE('add\\terminal_error\\error_trace', '');
                 }
                 if (!headers_sent() && !add::include_include_file('terminal_error.php')) {
                     throw new Exception("Failed to display terminal error");
                 }
                 add::shutdown(false);
             }
         }
     } catch (Exception $e3) {
         $e1_string = "<div style='color:red'>" . get_class($e) . "(#" . $e->getCode() . ")" . $e->getMessage() . "\r\n" . $e->getFile() . ":" . $e->getLine() . "</div>";
         echo $e1_string;
         $e3_string = "<div style='color:red'>" . get_class($e3) . "(#" . $e3->getCode() . ")" . $e3->getMessage() . "\r\n" . $e3->getFile() . ":" . $e3->getLine() . "</div>";
         if ($e3_string != $e1_string) {
             echo $e3_string;
         }
         debug::var_dump($e3->getTraceAsString());
         die;
     }
 }
开发者ID:google-code-backups,项目名称:add-mvc-framework,代码行数:59,代码来源:add.class.php

示例3: handle_exception

 /**
  * handle_exception()
  * The error handler for exceptions
  * @param Exception $e the exception to handle
  * @since ADD MVC 0.0
  */
 static function handle_exception(Exception $e)
 {
     try {
         if (method_exists($e, 'handle_exception')) {
             return $e->handle_exception();
         } else {
             while (ob_get_level()) {
                 ob_end_clean();
             }
             if ($e instanceof SmartyException) {
                 static::handle_exception(new e_smarty($e->getMessage(), $e));
             }
             if (add::content_type() == 'text/plain') {
                 die(get_class($e) . "(#" . $e->getCode() . ")\r\n\r\n" . $e->getMessage() . "\r\n\r\n" . $e->getFile() . ":" . $e->getLine() . "\r\n\r\n\r\n\r\n");
             } else {
                 DEFINE('add\\terminal_error\\error_message', $e->getMessage());
                 DEFINE('add\\terminal_error\\error_header', get_class($e));
                 DEFINE('add\\terminal_error\\error_footer', $e->getFile() . ":" . $e->getLine());
                 if (!headers_sent() && !add::include_include_file('terminal_error.php')) {
                     throw new $e();
                 }
                 add::shutdown(false);
             }
         }
     } catch (Exception $e) {
         die("<div style='color:red'>" . $e->getMessage() . "\r\n" . $e->getFile() . ":" . $e->getLine() . "</div>");
     }
 }
开发者ID:google-code-backups,项目名称:add-mvc-framework,代码行数:34,代码来源:add.class.php


注:本文中的add::include_include_file方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。