本文整理汇总了PHP中Nette\Diagnostics\Debugger::barDump方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::barDump方法的具体用法?PHP Debugger::barDump怎么用?PHP Debugger::barDump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Diagnostics\Debugger
的用法示例。
在下文中一共展示了Debugger::barDump方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dd
/** Bar dump */
function dd($var)
{
if (func_num_args() > 1) {
$var = func_get_args();
} else {
if (is_array($var)) {
$var = array(NULL => $var);
}
}
Debugger::barDump($var);
return func_get_arg(0);
}
示例2: bd
/**
* Bar dump shortcut.
* @see Nette\Diagnostics\Debugger::barDump
* @author Filip Procházka <filip@prochazka.su>
*
* @param mixed $var
* @param string $title
*
* @return mixed
*/
function bd($var, $title = NULL)
{
if (Debugger::$productionMode) {
return $var;
}
$trace = debug_backtrace();
$traceTitle = (isset($trace[1]['class']) ? htmlspecialchars($trace[1]['class']) . "->" : NULL) . htmlspecialchars($trace[1]['function']) . '()' . ':' . $trace[0]['line'];
if (!is_scalar($title) && $title !== NULL) {
foreach (func_get_args() as $arg) {
Nette\Diagnostics\Debugger::barDump($arg, $traceTitle);
}
return $var;
}
return Nette\Diagnostics\Debugger::barDump($var, $title ?: $traceTitle);
}
示例3: callback
/**
* @param string|null $strategy
* @return IOpauthIdentity
* @throws InvalidArgumentException
* @throws InvalidLoginException
*/
public function callback($strategy)
{
if ($strategy === NULL) {
throw new InvalidLoginException('No auth response. Probably user cancelled the process.');
}
if ($this->isFakeStrategy($strategy)) {
if ($this->config['debug'] != true) {
throw new InvalidLoginException("Fake login available only in debug mode!");
}
return $this->createIdentity(array('uid' => "123123123", 'info' => array('name' => "Chuck Norris", 'image' => "http://placekitten.com/465/465"), 'raw' => array('link' => "http://www.google.com/search?q=chuck+norris", 'email' => "gmail@chucknorris.com", 'given_name' => "Chuck", 'family_name' => "Norris"), 'provider' => 'Google'));
}
$Opauth = new \Opauth($this->config, false);
$response = null;
switch ($Opauth->env['callback_transport']) {
case 'session':
$response = $_SESSION['opauth'];
unset($_SESSION['opauth']);
break;
case 'post':
$response = unserialize(base64_decode($_POST['opauth']));
break;
case 'get':
$response = unserialize(base64_decode($_GET['opauth']));
break;
default:
throw new InvalidArgumentException("Unsupported callback transport.");
break;
}
if (array_key_exists('error', $response)) {
throw new InvalidLoginException($response['error']['message']);
}
if (empty($response['auth']) || empty($response['timestamp']) || empty($response['signature']) || empty($response['auth']['provider']) || empty($response['auth']['uid'])) {
throw new InvalidLoginException('Invalid auth response: Missing key auth response components');
} elseif (!$Opauth->validate(sha1(print_r($response['auth'], true)), $response['timestamp'], $response['signature'], $reason)) {
throw new InvalidLoginException('Invalid auth response: ' . $reason);
}
\Nette\Diagnostics\Debugger::barDump($response['auth'], 'authInfo');
return $this->createIdentity($response['auth']);
}
示例4: dump
public function dump($value)
{
Debugger::barDump($value);
}
示例5: bd
/**
* Shortcut for Debugger::barDump
*
* @author Jan Tvrdík
* @param mixed
* @param mixed $var, ... optional additional variable(s) to dump
* @return mixed the first dumped variable
*/
function bd($var, $title = NULL)
{
return Debugger::barDump($var, $title);
}
示例6: bd
function bd()
{
foreach (func_get_args() as $m) {
Nette\Diagnostics\Debugger::barDump($m);
}
}