本文整理汇总了PHP中Nette\Diagnostics\Debugger::logDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::logDirectory方法的具体用法?PHP Debugger::logDirectory怎么用?PHP Debugger::logDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Diagnostics\Debugger
的用法示例。
在下文中一共展示了Debugger::logDirectory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup
public static function setup($rootDir)
{
// configure environment
umask(0);
Tester\Environment::setup();
class_alias('Tester\\Assert', 'Assert');
date_default_timezone_set('Europe/Prague');
// create temporary directory
define('TEMP_DIR', $rootDir . '/tmp/' . (isset($_SERVER['argv']) ? md5(serialize($_SERVER['argv'])) : getmypid()));
Tester\Helpers::purge(TEMP_DIR);
@chmod(TEMP_DIR, 0777);
Nette\Diagnostics\Debugger::$logDirectory = TEMP_DIR;
$_SERVER = array_intersect_key($_SERVER, array_flip(array('PHP_SELF', 'SCRIPT_NAME', 'SERVER_ADDR', 'SERVER_SOFTWARE', 'HTTP_HOST', 'DOCUMENT_ROOT', 'OS', 'argc', 'argv')));
$_SERVER['REQUEST_TIME'] = 1234567890;
$_ENV = $_GET = $_POST = $_FILES = array();
if (extension_loaded('xdebug')) {
xdebug_disable();
Tester\CodeCoverage\Collector::start($rootDir . '/coverage.dat');
}
}
示例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: TemplateRouter
<?php
// Nette Framework Microblog example
use Nette\Diagnostics\Debugger;
// load libraries
require __DIR__ . '/../../../Nette/loader.php';
require __DIR__ . '/data/TemplateRouter.php';
// enable Debugger
Debugger::$logDirectory = __DIR__ . '/data/log';
Debugger::$strictMode = TRUE;
Debugger::enable();
// enable template router
$context = Nette\Environment::getContext();
$context->params['tempDir'] = __DIR__ . '/data/temp';
$context->application->router[] = new TemplateRouter('data/templates');
// add access to database
$context->addService('database', function() {
return new Nette\Database\Connection('sqlite2:data/blog.sdb');
});
// run the application!
示例4: catch
<?php
/**
* Tatami bootstrap file.
*
* @copyright Copyright (c) 2011 Martin Bazik
* @package Tatami
*/
use Nette\Diagnostics\Debugger, Nette\Application\Routers\SimpleRouter, Nette\Application\Routers\Route, Tatami\Events\Event;
// Load Nette Framework
$params['libsDir'] = __DIR__ . '/../libs';
require $params['libsDir'] . '/Nette/loader.php';
$params['logDir'] = __DIR__ . '/../log';
Debugger::$logDirectory = $params['logDir'];
Debugger::$strictMode = TRUE;
//Debugger::$productionMode = false;
Debugger::enable('188.167.64.246');
$params['assetsDir'] = __DIR__ . '/assets';
$configurator = new Nette\Configurator();
$configurator->container->params += $params;
$configurator->container->params['tempDir'] = __DIR__ . '/../temp';
//check if generated config exists
try {
$configurator->loadConfig($params['appDir'] . '/config/config.neon');
} catch (\Nette\FileNotFoundException $e) {
//if not, read the default config and install application
$configurator->loadConfig($params['appDir'] . '/config/config-default.neon');
}
$router = new \Tatami\Routing\TatamiRouter();
$configurator->getContainer()->addService('router', $router);
$application = $configurator->container->application;