Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

bootstrap.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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\Additionals\Tracking;
  17. use SCF\Core\Templates;
  18. /**
  19. * CREATE SYMLINK FOR BOOTSTRAP FOLDER IF NOT EXISTS!
  20. */
  21. if(!is_link(__DIR__."/web/lib/bootstrap")) {
  22. symlink(__DIR__."/vendor/twbs/bootstrap/dist", __DIR__."/web/lib/bootstrap");
  23. }
  24. /**
  25. * Check if Debug is Enabled and enabdle or disable Error Reporting
  26. */
  27. if($config['debug'] == 1 || $_GET['debug'] == 1) {
  28. error_reporting(E_ALL & ~E_NOTICE);
  29. Debug::enable(E_ALL & ~E_NOTICE);
  30. }
  31. else {
  32. error_reporting(0);
  33. Debug::enable(0);
  34. }
  35. $di = DI::getInstance();
  36. $di->set('db', new Database($config['dbext'], $config['server'], $config['mysqluser'], $config['mysqlpass'], $config['mysqldbname']), true);
  37. $di->set('router', 'AltoRouter', true);
  38. $di->set('tracking', new Tracking(DI::getInstance()->get('db')), true);
  39. $settings = new System(DI::getInstance()->get('db'));
  40. $router = DI::getInstance()->get('router');
  41. $tpl = new Templates($settings,$router);