Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 2.06 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. /**
  4.  * My Application bootstrap file.
  5.  */
  6. use Nette\Application\Routers\Route;
  7.  
  8.  
  9. // Load Nette Framework
  10. require LIBS_DIR . '/Nette/loader.php';
  11. require_once LIBS_DIR . '/dibi/dibi.php';
  12.  
  13.  
  14.  
  15. // Configure application
  16. $configurator = new Nette\Config\Configurator;
  17.  
  18. // Enable Nette Debugger for error visualisation & logging
  19. //$configurator->setDebugMode($configurator::AUTO);
  20. $configurator->enableDebugger(__DIR__ . '/../log');
  21.  
  22. // Enable RobotLoader - this will load all classes automatically
  23. $configurator->setTempDirectory(__DIR__ . '/../temp');
  24. $configurator->createRobotLoader()
  25.         ->addDirectory(APP_DIR)
  26.         ->addDirectory(LIBS_DIR)
  27.         ->register();
  28.  
  29.  
  30.  
  31. $configurator->onCompile[] = function ($configurator, $compiler) {
  32.     $compiler->addExtension('dibi', new DibiNetteExtension);
  33. };
  34.  
  35.  
  36. // Create Dependency Injection container from config.neon file
  37. $configurator->addConfig(__DIR__ . '/config/config.neon');
  38. $container = $configurator->createContainer();
  39.  
  40.  
  41.  
  42. // Setup router
  43. $container->router[] = new Route('index.php', 'Login:login', Route::ONE_WAY);
  44. $container->router[] = new Route('<presenter>/<action>[/<id>]', 'Student:terminy');
  45.  
  46.  
  47. // Configure and run the application!
  48. $container->application->run();
  49.  
  50.  
  51. ///////////////////////////////////// CONFIG.NEON
  52.  
  53. #
  54. # SECURITY WARNING: it is CRITICAL that this file & directory are NOT accessible directly via a web browser!
  55. #
  56. # If you don't protect this directory from direct web access, anybody will be able to see your passwords.
  57. # http://nette.org/security-warning
  58. #
  59.  
  60. common:
  61.         dibi:
  62.                 host: localhost
  63.                 username: root
  64.                 password: root
  65.                 database: vosprihlasovani
  66.  
  67.         php:
  68.                 date.timezone: Europe/Prague
  69.                 # session.save_path: "%tempDir%/sessions"
  70.                 # zlib.output_compression: yes
  71.  
  72.  
  73.         nette:
  74.                 session:
  75.                         expiration: '+ 14 days'
  76.  
  77.                 database:
  78.                         default:
  79.                                 dsn: '%database.driver%:host=%database.host%;dbname=%database.dbname%'
  80.                                 user: %database.user%
  81.                                 password: %database.password%
  82.  
  83.  
  84.         services:
  85.  
  86.                
  87.  
  88.         factories:
  89.  
  90.  
  91. production < common:
  92.  
  93. development < common: