index2.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /** Composer autoload */
  4. //require_once __DIR__.'/../vendor/autoload.php';
  5. /**
  6. * Classic global.inc.php file now returns a Application object
  7. * Make sure you read the documentation/installation_guide.html to learn how
  8. * to configure your VirtualHost to allow for overrides.
  9. */
  10. /**
  11. * Inclusion of main setup script
  12. */
  13. /**
  14. * In order to execute Chamilo, you need to call the $app->run() method.
  15. * This method renders a page depending of the URL, for example when entering
  16. * to "/web/index" Chamilo will call the controller "IndexController->indexAction()". This is
  17. * because a router was assigned in the router.php file
  18. *
  19. * $app->get('/index', 'index.controller:indexAction')->bind('index');
  20. *
  21. * The "index.controller:indexAction" string is transformed (due a
  22. * controller - service approach) into the method:
  23. * ChamiloLMS\Controller\IndexController->indexAction() see more
  24. * at: http://silex.sensiolabs.org/doc/providers/service_controller.html
  25. * The class is loaded automatically (no require_once needed) thanks to the
  26. * namespace ChamiloLMS added in Composer.
  27. * The location of the file is src\ChamiloLMS\Controller\IndexController.php
  28. * following the PSR-1 standards.
  29. */
  30. /** @var \Silex\Application $app */
  31. //$app->run();
  32. use Symfony\Component\HttpFoundation\Request;
  33. use Symfony\Component\Debug\Debug;
  34. error_reporting(-1);
  35. $loader = require_once __DIR__.'/../app/bootstrap.php.cache';
  36. //$app = require_once __DIR__ . '/../src/ChamiloLMS/CoreBundle/app.php';
  37. Debug::enable();
  38. require_once __DIR__.'/../app/AppKernel.php';
  39. $kernel = new AppKernel('dev', true);
  40. $kernel->loadClassCache();
  41. //$kernel = new AppCache($kernel);
  42. // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
  43. //Request::enableHttpMethodParameterOverride();
  44. $request = Request::createFromGlobals();
  45. /*$container = $kernel->getContainer();
  46. $container->enterScope('request');
  47. $request = $container->get('request_stack');
  48. use \ChamiloSession as Session;
  49. Session::setSession($request->getSession());*/
  50. //require_once __DIR__. '/../main/inc/lib/api.lib.php';
  51. $response = $kernel->handle($request);
  52. $response->send();
  53. $kernel->terminate($request, $response);