本文整理汇总了PHP中Debugger::outputAs方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::outputAs方法的具体用法?PHP Debugger::outputAs怎么用?PHP Debugger::outputAs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debugger
的用法示例。
在下文中一共展示了Debugger::outputAs方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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');
}
示例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;
}
示例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;
}
示例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);
}
示例5: array
<?php
App::uses('Hash', 'Utility');
// Output debug info as log in CLI
if (php_sapi_name() == 'cli') {
Debugger::outputAs('log');
}
$cakeResque = Configure::read('Resque');
$cakeResqueOverrides = Configure::read('ResqueOverrides');
Configure::write('Resque', Hash::merge((array) $cakeResque, $cakeResqueOverrides));
CakePlugin::load(array('Resque' => array('bootstrap' => true)));
Configure::write('Resque', Hash::merge((array) $cakeResque, $cakeResqueOverrides));
require_once APP . 'Plugin' . DS . 'Resque' . DS . 'Vendor' . DS . 'php-resque' . DS . 'lib' . DS . 'Resque.php';
Resque::setBackend(Configure::read('Resque.Redis.host') . ':' . Configure::read('Resque.Redis.port'));
示例6: _setDebuggerTypeAs
/**
* Debuggerの出力タイプを変更する
*
* @param Controller $controller
* @return void
*/
protected function _setDebuggerTypeAs(Controller $controller)
{
if ($this->setDebuggerTypeAs) {
Debugger::outputAs($this->setDebuggerTypeAs);
}
}