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

Untitled

By: a guest on May 6th, 2012  |  syntax: PHP  |  size: 1.36 KB  |  hits: 34  |  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. // bootstrap.php:
  2.  
  3.  
  4. <?php
  5.  
  6. /**
  7.  * My Application bootstrap file.
  8.  */
  9. use Nette\Application\Routers\Route;
  10.  
  11.  
  12. // Load Nette Framework
  13. require LIBS_DIR . '/Nette/loader.php';
  14. require LIBS_DIR . '/dibi/dibi.php';
  15.  
  16.  
  17. // Configure application
  18. $configurator = new Nette\Config\Configurator;
  19.  
  20. // Enable Nette Debugger for error visualisation & logging
  21. //$configurator->setDebugMode($configurator::AUTO);
  22. $configurator->enableDebugger(__DIR__ . '/../log');
  23.  
  24. // Enable RobotLoader - this will load all classes automatically
  25. $configurator->setTempDirectory(__DIR__ . '/../temp');
  26. $configurator->createRobotLoader()
  27.         ->addDirectory(APP_DIR)
  28.         ->addDirectory(LIBS_DIR)
  29.         ->register();
  30. $configurator->onCompile[] = function ($configurator, $compiler) {
  31.     $compiler->addExtension('dibi', new DibiNetteExtension);
  32. };
  33.  
  34. // Create Dependency Injection container from config.neon file
  35. $configurator->addConfig(__DIR__ . '/config/config.neon');
  36. $container = $configurator->createContainer();
  37.  
  38. // Setup router
  39. $container->router[] = new Route('index.php', 'Homepage:default', Route::ONE_WAY);
  40. $container->router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
  41.  
  42.  
  43.  
  44. // Configure and run the application!
  45. $container->application->run();
  46.  
  47. // config.neom :
  48.  
  49. common:
  50.         dibi:
  51.                 host: localhost
  52.                 username: root
  53.                 password:
  54.                 database: cleverdic