You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bootstrap.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. define('DS', '/');
  3. define('ROOT', __DIR__);
  4. define('APP','Application');
  5. define('VEND', ROOT."/vendor");
  6. /**
  7. * Load autoloaders and Config files
  8. */
  9. require_once ROOT."/autoload.php";
  10. require_once VEND."/autoload.php";
  11. require_once ROOT.DS.APP."/Config/config.php";
  12. use Symfony\Component\Debug\Debug;
  13. use SCF\Core\DI;
  14. use SCF\Core\Database;
  15. use SCF\Core\System;
  16. use SCF\Core\Templates;
  17. /**
  18. * CREATE SYMLINK FOR BOOTSTRAP FOLDER IF NOT EXISTS!
  19. */
  20. if(!is_link(__DIR__."/web/lib/bootstrap")) {
  21. symlink(__DIR__."/vendor/twbs/bootstrap/dist", __DIR__."/web/lib/bootstrap");
  22. }
  23. /**
  24. * Check if Debug is Enabled and enabdle or disable Error Reporting
  25. */
  26. if($config['debug'] == 1 || $_GET['debug'] == 1) {
  27. error_reporting(E_ALL & ~E_NOTICE);
  28. Debug::enable(E_ALL & ~E_NOTICE);
  29. }
  30. else {
  31. error_reporting(0);
  32. Debug::enable(0);
  33. }
  34. $di = DI::getInstance();
  35. $di->set('db', new Database($config['dbext'], $config['server'], $config['mysqluser'], $config['mysqlpass'], $config['mysqldbname']), true);
  36. $di->set('router', 'AltoRouter', true);
  37. $settings = new System(DI::getInstance()->get('db'));
  38. $router = DI::getInstance()->get('router');
  39. $tpl = new Templates($settings,$router);