Guest User

nett bootstrap.php

a guest
Jan 29th, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.33 KB | None | 0 0
  1. <?php
  2. /**
  3. * My Application bootstrap file.
  4. */
  5.  
  6. use Nette\Diagnostics\Debugger,
  7.     Nette\Application\Routers\Route,
  8.     Nette\Application\Routers\RouteList,
  9.     Nette\Caching\Cache;
  10.  
  11.  
  12. // Load Nette Framework
  13. $params['libsDir'] = __DIR__ . '/../libs';
  14. require $params['libsDir'] . '/Nette/loader.php';
  15. //require $params['libsDir'] . '/Nette-minified/nette.min.php';
  16.  
  17.  
  18. // Enable Nette Debugger for error visualisation & logging
  19. Debugger::$logDirectory = __DIR__ . '/../log';
  20. Debugger::$strictMode = true;
  21. Debugger::enable(Debugger::DEVELOPMENT);
  22.  
  23. // For debugging reasons only
  24. function dp($_val = '') {
  25.     Debugger::dump($_val);
  26.     die();exit();
  27. }
  28.  
  29. // Load configuration from config.neon file
  30. $configurator = new Nette\Config\Configurator;
  31. $configurator->container->params += $params;
  32. $container = $configurator->loadConfig(__DIR__ . '/config.neon');
  33.  
  34. // Session
  35. $container->session->setExpiration('+ 14  days');
  36.  
  37. // Setup router
  38. $router = $container->router;
  39. $router[] = $container->getService('databaseRoute');
  40. $router[] = $frontRouter = new RouteList('Front');
  41. $frontRouter[] = new Route('index', 'Homepage:default', Route::ONE_WAY);
  42.  
  43. // Configure and run the application!
  44. $application = $container->application;
  45. $application->catchExceptions = false;
  46. $application->errorPresenter = 'Error';
  47.  
  48. $application->run();
Advertisement
Add Comment
Please, Sign In to add comment