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


PHP Debugger::barDump方法代碼示例

本文整理匯總了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);
}
開發者ID:rostenkowski,項目名稱:HttpPHPUnit,代碼行數:13,代碼來源:dump.php

示例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);
}
開發者ID:hosiplan,項目名稱:project,代碼行數:25,代碼來源:functions.php

示例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']);
 }
開發者ID:michalsvec,項目名稱:nette-opauth,代碼行數:45,代碼來源:NetteOpauth.php

示例4: dump

 public function dump($value)
 {
     Debugger::barDump($value);
 }
開發者ID:cactucs,項目名稱:debugger,代碼行數:4,代碼來源:nette.php

示例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);
}
開發者ID:newPOPE,項目名稱:web-addons.nette.org,代碼行數:12,代碼來源:functions.php

示例6: bd

function bd()
{
    foreach (func_get_args() as $m) {
        Nette\Diagnostics\Debugger::barDump($m);
    }
}
開發者ID:vbuilder,項目名稱:framework,代碼行數:6,代碼來源:shortcuts.php


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