本文整理匯總了PHP中Nette\Diagnostics\Debugger::addPanel方法的典型用法代碼示例。如果您正苦於以下問題:PHP Debugger::addPanel方法的具體用法?PHP Debugger::addPanel怎麽用?PHP Debugger::addPanel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Nette\Diagnostics\Debugger
的用法示例。
在下文中一共展示了Debugger::addPanel方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dbConnect
/**
* Connection factory. Connects to DB.
*
* @param Nette\DI\IContainer $container
* @return NotORM
*/
public static function dbConnect(IContainer $container)
{
$db = $container->params['database'];
$dsn = (isset($db->port))
? "{$db->driver}:host={$db->host};dbname={$db->database};port={$db->port}"
: "{$db->driver}:host={$db->host};dbname={$db->database}";
$pdo = new PDO($dsn, $db->username, $db->password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->query('SET NAMES utf8');
$conn = new NotORM($pdo, new NotORM_Structure_Convention('id', '%s_id', '%ss'), new NotORM_Cache_Session);
if ($db->profiler) {
$panel = Panel::getInstance();
$panel->setPlatform($db->driver);
Debugger::addPanel($panel);
$conn->debug = function($query, $parameters) {
Panel::getInstance()->logQuery($query, $parameters);
};
}
return $conn;
}
示例2: register
public static function register()
{
//register panel only once
if (!self::$registered) {
Debugger::addPanel(new self());
self::$registered = TRUE;
}
}
示例3: register
public static function register($container)
{
$panel = new self();
Debugger::addPanel($panel);
if (static::$appDir === null) {
static::$appDir = \jasir\FileHelpers\File::simplifyPath(__DIR__ . '/../../../../app');
}
$application = $container->getService('application');
$application->onResponse[] = callback(array($panel, 'getResponseCb'));
}
示例4:
function __construct(Presenter $presenter)
{
$this->presenter = $presenter;
Debugger::addPanel($this, $this->getId());
}
示例5: __construct
/**
* Constructor
*
* @param Nette\DI\Container DI
*/
public function __construct(Nette\DI\Container $context)
{
parent::__construct($context);
Nette\Diagnostics\Debugger::addPanel(new vBuilder\Diagnostics\OrmSessionBar());
}
示例6: __construct
/**
* Constructor
*
* @param Nette\DI\Container $context
*/
function __construct(Nette\DI\Container $context)
{
$this->context = $context;
Nette\Diagnostics\Debugger::addPanel(new vBuilder\Diagnostics\WebFilesBar());
}
示例7: register
public function register()
{
Debugger::addPanel($this, 'dk.translator');
}
示例8: register
/**
* Registers panel to Debug bar
*/
static function register()
{
Debugger::addPanel(new self());
}
示例9: register
/**
* Registers panel to Debug bar
*/
static function register(Presenter $presenter)
{
Debugger::addPanel(new self($presenter));
}