index.php line 58

Open in your IDE?
  1. <?php
  2. //CLI/Nginx/Cron: We need to set the "current working directory" to this folder
  3. chdir(__DIR__);
  4. // vendors not installed
  5. if (!is_dir(__DIR__ '/vendor')) {
  6.     echo 'Your install is missing some dependencies. If you have composer
  7.          installed you should run: <code>composer install</code>. If you
  8.          don\'t have composer installed you really should, see
  9.          http://getcomposer.org for more information';
  10.     return;
  11. }
  12. require_once __DIR__ '/autoload.php';
  13. use IcebirdCMS\App\AppKernel;
  14. use Symfony\Component\DependencyInjection\ContainerInterface;
  15. use Symfony\Component\HttpFoundation\Request;
  16. use Symfony\Component\Debug\Debug;
  17. use Symfony\Component\HttpFoundation\Session\Session;
  18. // get environment and debug mode from environment variables
  19. $session = new Session();
  20. //$debug = ($session->get('user_debug', false)) ? 1 : 0;
  21. //$env = ($session->get('user_env', false)) ? 'dev' : 'prod';
  22. //BIJ LIVE 24 en 25 aan 28 en 29 UIT
  23. $debug 1;
  24. $env 'dev';
  25. // icebird has not yet been installed
  26. $parametersFile __DIR__ '/app/config/parameters.yml';
  27. $request Request::createFromGlobals();
  28. if (!file_exists($parametersFile)) {
  29.     $env 'install';
  30.     if (strpos($request->getRequestUri(), '/install') !== 0) {
  31.         // check .htaccess
  32.         if (!$request->query->has('skiphtaccess') && !file_exists('.htaccess')) {
  33.             echo 'Your install is missing the .htaccess file. Make sure you show
  34.                  hidden files while uploading icebird CMS.';
  35.             return;
  36.         }
  37.         header('Location: /install');
  38.         return;
  39.     }
  40. }
  41. if (extension_loaded('newrelic')) {
  42.     newrelic_name_transaction(strtok($request->getRequestUri(), '?'));
  43. }
  44. if ($debug) {
  45.     Debug::enable();
  46. }
  47. $kernel = new AppKernel($env$debug);
  48. $response $kernel->handle($request);
  49. if ($response->getCharset() === null && $kernel->getContainer() instanceof ContainerInterface) {
  50.     $response->setCharset(
  51.         $kernel->getContainer()->getParameter('kernel.charset')
  52.     );
  53. }
  54. $response->send();
  55. $kernel->terminate($request$response);