當前位置: 首頁>>代碼示例>>PHP>>正文


PHP add::handle_exception方法代碼示例

本文整理匯總了PHP中add::handle_exception方法的典型用法代碼示例。如果您正苦於以下問題:PHP add::handle_exception方法的具體用法?PHP add::handle_exception怎麽用?PHP add::handle_exception使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在add的用法示例。


在下文中一共展示了add::handle_exception方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: page

 /**
  * run the page
  *
  * @since ADD MVC 0.4
  */
 public function page()
 {
     header("Content-type: text/plain");
     e_hack::assert($this->can_run(), "Invalid aux script authentication key");
     ob_start();
     try {
         $this->process();
     } catch (Exception $e) {
         add::handle_exception($e);
     }
     $this->response = ob_get_clean();
     $this->handle_response();
 }
開發者ID:google-code-backups,項目名稱:add-mvc-framework,代碼行數:18,代碼來源:ctrl_tpl_aux.class.php

示例2: execute

 /**
  * run the page
  *
  * @since ADD MVC 0.6.2
  */
 public function execute()
 {
     e_hack::assert($this->can_run(), "Invalid aux script authentication key");
     # Set Content Type
     $this->content_type($this->content_type);
     ob_start();
     try {
         $this->process_data();
     } catch (Exception $e) {
         add::handle_exception($e);
     }
     $this->response = ob_get_clean();
     $this->handle_response();
 }
開發者ID:google-code-backups,項目名稱:add-mvc-framework,代碼行數:19,代碼來源:ctrl_tpl_aux.class.php

示例3: handle_shutdown

 /**
  * Handle shutdown
  * When development, record the time spent on script execution (since 0.7.2)
  *
  * @since ADD MVC 0.5.1
  */
 static function handle_shutdown()
 {
     try {
         while (ob_get_level()) {
             # Do not echo this, it is a big security risk
             ob_get_clean();
         }
         if (static::$handle_shutdown && !add::is_live() && add::is_developer()) {
             global $add_mvc_root_timer;
             $smarty = new add_smarty();
             $smarty->display('debug/handle_shutdown.tpl');
             if (isset($add_mvc_root_timer) && $add_mvc_root_timer instanceof add_debug_timer) {
                 add_debug::print_config('environment_status');
                 add_debug::print_config('add_dir');
                 add_debug::print_config('path');
                 add_debug::print_config('developer_ips', true);
                 add_debug::print_data('current_user_ip', current_user_ip());
                 add_debug::print_data('POST variable', $_POST);
                 add_debug::print_data('GET variable', $_GET);
                 add_debug::print_data('COOKIE variable', $_COOKIE);
                 add_debug::print_data('REQUEST variable', $_COOKIE);
                 if (isset($_SESSION)) {
                     add_debug::print_data('SESSION variable', $_SESSION);
                 }
                 $add_mvc_root_timer->lap("Shutdown");
                 $add_mvc_root_timer->print_all_laps();
             }
             return static::print_errors();
         }
     } catch (Exception $e) {
         add::$handle_shutdown = false;
         add::handle_exception($e);
     }
 }
開發者ID:google-code-backups,項目名稱:add-mvc-framework,代碼行數:40,代碼來源:add.class.php

示例4: my_encryptor2

$encrypted3 = $encryptor3->encrypt();
debug::var_dump($encrypted3);
$encryptor4 = new my_encryptor2($encrypted3, 'wrong key');
$encrypted4 = $encryptor4->encrypt();
debug::var_dump($encrypted4);
$decryptor = my_encryptor2::from_encrypted($encrypted4, 'lololo');
$decrypted = $decryptor->string;
debug::var_dump($decrypted);
$decryptor2 = my_encryptor::from_encrypted($decrypted, 'lalala');
$decrypted2 = $decryptor2->string;
debug::var_dump($decrypted2);
$decryptor3 = my_encryptor2::from_encrypted($decrypted2);
$decrypted3 = $decryptor3->string;
debug::var_dump($decrypted3);
$decryptor4 = my_encryptor::from_encrypted($decrypted3);
$decrypted4 = $decryptor4->string;
debug::var_dump($decrypted4);
# No key
$encryptor5 = new add_encryptor('of the Great Amen', null);
try {
    debug::var_dump($encryptor5->encrypt(), $encryptor5);
} catch (Exception $e) {
    add::handle_exception($e);
}
# Invalid key
$encryptor6 = new add_encryptor('of the Great Amen', array());
try {
    debug::var_dump($encryptor6->encrypt(), $encryptor6);
} catch (Exception $e) {
    add::handle_exception($e);
}
開發者ID:google-code-backups,項目名稱:add-mvc-framework,代碼行數:31,代碼來源:encryptor.php


注:本文中的add::handle_exception方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。