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


PHP Debugger::addFormat方法代碼示例

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


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

示例1: testOutput

 /**
  * test output switch to firePHP
  *
  * @return void
  */
 public function testOutput()
 {
     Debugger::getInstance('DebugKitDebugger');
     Debugger::addFormat('fb', array('callback' => 'DebugKitDebugger::fireError'));
     Debugger::outputAs('fb');
     set_error_handler('ErrorHandler::handleError');
     $foo .= '';
     restore_error_handler();
     $result = $this->firecake->sentHeaders;
     $this->assertRegExp('/GROUP_START/', $result['X-Wf-1-1-1-1']);
     $this->assertRegExp('/ERROR/', $result['X-Wf-1-1-1-2']);
     $this->assertRegExp('/GROUP_END/', $result['X-Wf-1-1-1-5']);
     Debugger::getInstance('Debugger');
     Debugger::outputAs('html');
 }
開發者ID:juliocp88,項目名稱:cakephp-example,代碼行數:20,代碼來源:DebugKitDebuggerTest.php

示例2: output

 /**
  * Switches output format, updates format strings.
  * Can be used to switch the active output format:
  *
  * @param string $format  Format to use, including 'js' for JavaScript-enhanced HTML, 'html' for
  *                        straight HTML output, or 'txt' for unformatted text.
  * @param array  $strings Template strings to be used for the output format.
  *
  * @return string
  * @deprecated 3.0.0 Use Debugger::outputAs() and Debugger::addFormat(). Will be removed
  *   in 3.0
  */
 public static function output($format = NULL, $strings = array())
 {
     $self = Debugger::getInstance();
     $data = NULL;
     if ($format === NULL) {
         return Debugger::outputAs();
     }
     if (!empty($strings)) {
         return Debugger::addFormat($format, $strings);
     }
     if ($format === TRUE && !empty($self->_data)) {
         $data = $self->_data;
         $self->_data = array();
         $format = FALSE;
     }
     Debugger::outputAs($format);
     return $data;
 }
開發者ID:mrbadao,項目名稱:api-official,代碼行數:30,代碼來源:Debugger.php

示例3: output

 /**
  * Switches output format, updates format strings.
  * Can be used to switch the active output format:
  *
  * @param string $format Format to use, including 'js' for JavaScript-enhanced HTML, 'html' for
  *    straight HTML output, or 'txt' for unformatted text.
  * @param array $strings Template strings to be used for the output format.
  * @return string
  * @deprecated Use Debugger::outputAs() and Debugger::addFormat(). Will be removed
  *   in 3.0
  */
 public function output($format = null, $strings = array())
 {
     $self = Debugger::getInstance();
     $data = null;
     if ($format === null) {
         return Debugger::outputAs();
     }
     if (!empty($strings)) {
         return Debugger::addFormat($format, $strings);
     }
     if ($format === true && !empty($self->_data)) {
         $data = $self->_data;
         $self->_data = array();
         $format = false;
     }
     Debugger::outputAs($format);
     return $data;
 }
開發者ID:jgera,項目名稱:orangescrum,代碼行數:29,代碼來源:Debugger.php

示例4: testAddFormatCallback

 /**
  * Test adding a format that is handled by a callback.
  *
  * @return void
  */
 public function testAddFormatCallback()
 {
     set_error_handler('Debugger::showError');
     $this->_restoreError = true;
     Debugger::addFormat('callback', array('callback' => array($this, 'customFormat')));
     Debugger::outputAs('callback');
     ob_start();
     $foo .= '';
     $result = ob_get_clean();
     $this->assertContains('Notice: I eated an error', $result);
     $this->assertContains('DebuggerTest.php', $result);
 }
開發者ID:ronaldsalazar23,項目名稱:ComercialChiriguano,代碼行數:17,代碼來源:DebuggerTest.php

示例5: clearMemoryPoints

     * @deprecated Use DebugMemory::clear() instead.
     */
    public static function clearMemoryPoints()
    {
        return DebugMemory::clear();
    }
    /**
     * Create a FirePHP error message
     *
     * @param array $data Data of the error
     * @param array $links  Links for the error
     * @return void
     */
    public static function fireError($data, $links)
    {
        $name = $data['error'] . ' - ' . $data['description'];
        $message = "{$data['error']} {$data['code']} {$data['description']} on line: {$data['line']} in file: {$data['file']}";
        FireCake::group($name);
        FireCake::error($message, $name);
        if (isset($data['context'])) {
            FireCake::log($data['context'], 'Context');
        }
        if (isset($data['trace'])) {
            FireCake::log($data['trace'], 'Trace');
        }
        FireCake::groupEnd();
    }
}
DebugKitDebugger::getInstance('DebugKitDebugger');
Debugger::addFormat('fb', array('callback' => 'DebugKitDebugger::fireError'));
開發者ID:huanjian,項目名稱:mythesis,代碼行數:30,代碼來源:DebugKitDebugger.php


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