本文整理汇总了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));
}