<?php /** * My Application bootstrap file. */ // Load Nette Framework require LIBS_DIR . '/Nette/loader.php'; // Enable Nette Debugger for error visualisation & logging NDebugger::$logDirectory = dirname(__FILE__) . '/../log'; NDebugger::$strictMode = TRUE; NDebugger::enable(); // Configure application $configurator = new NConfigurator(); $configurator->setTempDirectory(dirname(__FILE__) . '/../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(dirname(__FILE__) . '/config/config.neon'); $container = $configurator->createContainer(); // Opens already started session if ($container->session->exists()) { $container->session->start(); } // Setup router $router = $container->router; $router[] = new NRoute('index.php', 'Dashboard:default', NRoute::ONE_WAY); $router[] = new NRoute('<presenter>/<action>[/<id>]', 'Dashboard:default'); // Configure and run the application! $application = $container->application; //$application->catchExceptions = TRUE; $application->errorPresenter = 'Error';
// absolute filesystem path to the application root define('APP_DIR', WWW_DIR . '../app'); // absolute filesystem path to the libraries define('LIBS_DIR', WWW_DIR . '../vendor'); // absolute filesystem path to the temporary files define('TEMP_DIR', APP_DIR . '/temp'); // absolute filesystem path to the temporary files define('LOG_DIR', APP_DIR . '/log'); require LIBS_DIR . '/nette.min.php'; require LIBS_DIR . '/shortcuts.php'; // Configure application $configurator = new NConfigurator(); $configurator->setProductionMode(false); $configurator->enableDebugger(LOG_DIR); // Enable RobotLoader - this will load all classes automatically $configurator->setTempDirectory(TEMP_DIR); $configurator->createRobotLoader()->addDirectory(LIBS_DIR)->addDirectory(APP_DIR)->register(); // Create Dependency Injection container from config.neon file //$configurator->addConfig(APP_DIR . '/config/config.neon'); $configurator->addConfig(APP_DIR . '/config/config.db.neon'); $container = $configurator->createContainer(); function adminer_object() { class AdminerSoftware extends Adminer { private $container; private $user; function __construct(SystemContainer $container) { $this->container = $container; $this->user = $container->getService('user');