Пример #1
0
function wp_tracy_init_action()
{
    if (defined("DOING_AJAX") && DOING_AJAX) {
        return;
        // for IE compatibility WordPress media upload
    }
    if (defined("WP_TRACY_CHECK_USER_LOGGED_IN") && WP_TRACY_CHECK_USER_LOGGED_IN && is_user_logged_in()) {
        return;
        // cancel for anonymous users
    }
    Tracy\Debugger::enable(defined("WP_TRACY_ENABLE_MODE") ? WP_TRACY_ENABLE_MODE : null);
    // hooray, enabling debugging using Tracy
    // panels in the correct order
    $defaultPanels = array("WpTracy\\WpPanel", "WpTracy\\WpUserPanel", "WpTracy\\WpPostPanel", "WpTracy\\WpQueryPanel", "WpTracy\\WpQueriedObjectPanel", "WpTracy\\WpDbPanel", "WpTracy\\WpRewritePanel");
    $panels = apply_filters("wp_tracy_panels_filter", $defaultPanels);
    // panels registration
    foreach ($panels as $className) {
        Tracy\Debugger::getBar()->addPanel(new $className());
    }
}
 /**
  * @return Nette\Security\User
  */
 public function createServiceUser()
 {
     $service = new Nette\Security\User($this->getService('nette.userStorage'), $this->getService('authenticator'));
     Tracy\Debugger::getBar()->addPanel(new Nette\Bridges\SecurityTracy\UserPanel($service));
     return $service;
 }
Пример #3
0
 /**
  * @return Tracy\Bar
  */
 public function createServiceTracy__bar()
 {
     $service = Tracy\Debugger::getBar();
     if (!$service instanceof Tracy\Bar) {
         throw new Nette\UnexpectedValueException('Unable to create service \'tracy.bar\', value returned by factory is not Tracy\\Bar type.');
     }
     return $service;
 }
Пример #4
0
<?php

require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../vendor/others/functions.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode(true);
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../vendor/others')->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
Tracy\Debugger::getBar()->addPanel(new \Asterix\LogPanel());
\Kdyby\Events\DI\EventsExtension::register($configurator);
$container = $configurator->createContainer();
return $container;
Пример #5
0
<?php

if (defined("DOING_AJAX") && DOING_AJAX) {
    return;
    // for IE compatibility WordPress media upload
}
if (defined("WP_TRACY_CHECK_USER_LOGGED_IN") && WP_TRACY_CHECK_USER_LOGGED_IN && is_user_logged_in()) {
    return;
    // cancel for anonymous users
}
Tracy\Debugger::enable();
// hooray, enabling debugging using Tracy
// panels in the correct order
$panels = array("WpTracy\\WpPanel", "WpTracy\\WpUserPanel", "WpTracy\\WpPostPanel", "WpTracy\\WpQueryPanel", "WpTracy\\WpDbPanel", "WpTracy\\WpRewritePanel");
// panels registration
foreach ($panels as $className) {
    Tracy\Debugger::getBar()->addPanel(new $className());
}
 public static function init()
 {
     if (!Tracy\Debugger::$productionMode) {
         Tracy\Debugger::getBar()->addPanel(new self());
     }
 }