本文整理汇总了PHP中Configurator::createRobotLoader方法的典型用法代码示例。如果您正苦于以下问题:PHP Configurator::createRobotLoader方法的具体用法?PHP Configurator::createRobotLoader怎么用?PHP Configurator::createRobotLoader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configurator
的用法示例。
在下文中一共展示了Configurator::createRobotLoader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: barDump
// 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');
$frontRouter[] = new Route('data/thumbs/<id>[.<opts>].png', 'Files:preview');