本文整理汇总了PHP中Nette\Diagnostics\Debugger::strictMode方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::strictMode方法的具体用法?PHP Debugger::strictMode怎么用?PHP Debugger::strictMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Diagnostics\Debugger
的用法示例。
在下文中一共展示了Debugger::strictMode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: enableDebugger
/**
* @param string error log directory
* @param string administrator email
* @return void
*/
public function enableDebugger($logDirectory = NULL, $email = NULL)
{
Nette\Diagnostics\Debugger::$strictMode = TRUE;
Nette\Diagnostics\Debugger::enable($this->parameters['productionMode'], $logDirectory, $email);
}
示例2: Route
<?php
/**
* My Application bootstrap file.
*/
use Nette\Diagnostics\Debugger, Nette\Application\Routers\Route;
// Load Nette Framework
require LIBS_DIR . '/Nette/loader.php';
// Enable Nette Debugger for error visualisation & logging
Debugger::$logDirectory = __DIR__ . '/../log';
Debugger::$strictMode = TRUE;
Debugger::enable();
// Configure application
$configurator = new Nette\Config\Configurator();
$configurator->setTempDirectory(__DIR__ . '/../temp');
// Enable RobotLoader - this will load all classes automatically
$configurator->createRobotLoader()->addDirectory(APP_DIR)->addDirectory(LIBS_DIR)->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$container = $configurator->createContainer();
// Opens already started session
if ($container->session->exists()) {
$container->session->start();
}
// Setup router
$router = $container->router;
if (MobileDetection::isMobile()) {
// mobile routing
$router[] = new Route('index.php', 'Mobile:Homepage:default', Route::ONE_WAY);
$router[] = new Route('<presenter>/<action>[/<id>]', 'Mobile:Homepage:default');
} else {
示例3: die
echo "Required dependency missing: Nette Framework\n";
die(1);
}
if (!class_exists('Texy')) {
echo "Required dependency missing: Texy library\n";
die(1);
}
if (!class_exists('FSHL\\Highlighter')) {
echo "Required dependency missing: FSHL library\n";
die(1);
}
if (!class_exists('TokenReflection\\Broker')) {
echo "Required dependency missing: TokenReflection library\n";
die(1);
}
Debugger::$strictMode = true;
Debugger::$onFatalError[] = function () {
echo "\nFor more information turn on the debug mode using the --debug option.\n";
};
Debugger::enable(Debugger::PRODUCTION, false);
$start = new \DateTime();
$options = $_SERVER['argv'];
array_shift($options);
$config = new Config();
$config->processCliOptions($options);
$generator = new Generator($config);
// Help
if ($config->isHelpRequested()) {
echo $generator->colorize($generator->getHeader());
echo $generator->colorize($config->getHelp());
die;
示例4: debug
/**
* Nette\Diagnostics\Debugger::enable() shortcut.
*/
function debug()
{
Debugger::$strictMode = TRUE;
Debugger::enable(Debugger::DEVELOPMENT);
}
示例5: enableDebugger
/**
* @param string error log directory
* @param string administrator email
*/
public function enableDebugger($logDirectory = NULL, $email = NULL)
{
$debugMode = $this->isDebugMode();
if (isset($this->parameters['debugModeLogin']['name']) && isset($this->parameters['debugModeLogin']['password'])) {
if (isset($_GET['debugMode'])) {
if ($_GET['debugMode']) {
if (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] !== $this->parameters['debugModeLogin']['name'] || $_SERVER['PHP_AUTH_PW'] !== $this->parameters['debugModeLogin']['password']) {
header('WWW-Authenticate: Basic realm="Debug mode"');
header('HTTP/1.0 401 Unauthorized');
exit;
}
}
}
if (isset($this->parameters['debugModeLogin']['name']) && isset($this->parameters['debugModeLogin']['password']) && isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_USER'] === $this->parameters['debugModeLogin']['name'] && $_SERVER['PHP_AUTH_PW'] === $this->parameters['debugModeLogin']['password']) {
$debugMode = TRUE;
}
}
Debugger::$strictMode = TRUE;
Debugger::enable(!$debugMode, $logDirectory ?: $this->parameters['logDir'], $email);
}
示例6: RobotLoader
<?php
define('LIBS_DIR', __DIR__ . '/../libs');
require_once LIBS_DIR . '/Nette/loader.php';
require_once LIBS_DIR . '/dump.php';
use Nette\Diagnostics\Debugger as Debug;
use Nette\Environment;
use Nette\Loaders\RobotLoader;
Debug::enable(false);
Debug::$strictMode = true;
Environment::setVariable('tempDir', __DIR__ . '/tmp');
$r = new RobotLoader();
$r->setCacheStorage(Environment::getContext()->cacheStorage);
$r->addDirectory(LIBS_DIR);
$r->addDirectory(__DIR__ . '/cases');
$r->register();
require_once __DIR__ . '/TestCase.php';