本文整理匯總了PHP中Configurator::setTempDirectory方法的典型用法代碼示例。如果您正苦於以下問題:PHP Configurator::setTempDirectory方法的具體用法?PHP Configurator::setTempDirectory怎麽用?PHP Configurator::setTempDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Configurator
的用法示例。
在下文中一共展示了Configurator::setTempDirectory方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: barDump
$_SERVER['SCRIPT_NAME'] = preg_replace('~/index\\.php$~', '', $_SERVER['SCRIPT_NAME']);
// Load Nette Framework
require LIBS_DIR . '/nette/loader.php';
define("NPRESS", "<span title='2016/02/05'>v1.0</span>");
// Configure application
$configurator = new Configurator();
$configurator->addParameters(array('npDir' => LIBS_DIR . '/npress', 'appDir' => APP_DIR));
// Enable Nette Debugger for error visualisation & logging
//$configurator->setProductionMode(FALSE);
$configurator->enableDebugger(APP_DIR . '/log');
function barDump($x)
{
Debugger::barDump($x);
}
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(APP_DIR . '/temp');
$configurator->createRobotLoader()->addDirectory(APP_DIR)->addDirectory(LIBS_DIR)->register();
// Create Dependency Injection container from config.neon files
$configurator->addConfig(LIBS_DIR . '/npress/config.neon');
$configurator->addConfig(APP_DIR . '/config.neon');
$configurator->addConfig(WWW_DIR . '/data/config.neon');
if (file_exists(WWW_DIR . '/data/config.local.neon')) {
$configurator->addConfig(WWW_DIR . '/data/config.local.neon');
}
$container = $configurator->createContainer();
// Connect to the database
dibi::connect($container->params['database']);
// Setup router
$container->router[] = $adminRouter = new RouteList('Admin');
$adminRouter[] = new Route('admin/<presenter>/<action>[/<id_page>]', 'Admin:default', isset($_SERVER['HTTPS']) ? Route::SECURED : false);
$container->router[] = $frontRouter = new RouteList('Front');