- <?php
- /**
- * My Application bootstrap file.
- */
- use Nette\Application\Routers\Route;
- // Load Nette Framework
- require LIBS_DIR . '/Nette/loader.php';
- require_once LIBS_DIR . '/dibi/dibi.php';
- // Configure application
- $configurator = new Nette\Config\Configurator;
- // Enable Nette Debugger for error visualisation & logging
- //$configurator->setDebugMode($configurator::AUTO);
- $configurator->enableDebugger(__DIR__ . '/../log');
- // Enable RobotLoader - this will load all classes automatically
- $configurator->setTempDirectory(__DIR__ . '/../temp');
- $configurator->createRobotLoader()
- ->addDirectory(APP_DIR)
- ->addDirectory(LIBS_DIR)
- ->register();
- $configurator->onCompile[] = function ($configurator, $compiler) {
- $compiler->addExtension('dibi', new DibiNetteExtension);
- };
- // Create Dependency Injection container from config.neon file
- $configurator->addConfig(__DIR__ . '/config/config.neon');
- $container = $configurator->createContainer();
- // Setup router
- $container->router[] = new Route('index.php', 'Login:login', Route::ONE_WAY);
- $container->router[] = new Route('<presenter>/<action>[/<id>]', 'Student:terminy');
- // Configure and run the application!
- $container->application->run();
- ///////////////////////////////////// CONFIG.NEON
- #
- # SECURITY WARNING: it is CRITICAL that this file & directory are NOT accessible directly via a web browser!
- #
- # If you don't protect this directory from direct web access, anybody will be able to see your passwords.
- # http://nette.org/security-warning
- #
- common:
- dibi:
- host: localhost
- username: root
- password: root
- database: vosprihlasovani
- php:
- date.timezone: Europe/Prague
- # session.save_path: "%tempDir%/sessions"
- # zlib.output_compression: yes
- nette:
- session:
- expiration: '+ 14 days'
- database:
- default:
- dsn: '%database.driver%:host=%database.host%;dbname=%database.dbname%'
- user: %database.user%
- password: %database.password%
- services:
- factories:
- production < common:
- development < common: