public/index.php line 74

Open in your IDE?
  1. <?php
  2. // identify NextTuesday env
  3. $env 'NONE';
  4. if (strpos($_SERVER['HTTP_REFERER'], "mein.kombiverkehr.de") !== FALSE) {
  5.     $allowedOrigins = [
  6.         'https://mein.kombiverkehr.de',
  7.         'https://system.kombiverkehr.de'
  8.     ];
  9.     $ref rtrim($_SERVER['HTTP_REFERER'], '/');
  10.     if (in_array($ref$allowedOrigins)) {
  11.         $env $ref;
  12.     }
  13.     header("Access-Control-Allow-Origin: $env");
  14. } else if (strpos($_SERVER['HTTP_REFERER'], "staging") !== FALSE) {
  15.     $allowedOrigins = [
  16.         'https://mein.staging.kombiverkehr.de',
  17.         'https://system.staging.kombiverkehr.de'
  18.     ];
  19.     $ref rtrim($_SERVER['HTTP_REFERER'], '/');
  20.     if (in_array($ref$allowedOrigins)) {
  21.         $env $ref;
  22.     }
  23.     header("Access-Control-Allow-Origin: $env");
  24. } else if (strpos($_SERVER['HTTP_REFERER'], "development") !== FALSE) {
  25.     $allowedOrigins = [
  26.         'https://mein.development.kombiverkehr.de',
  27.         'https://system.development.kombiverkehr.de'
  28.     ];
  29.     $ref rtrim($_SERVER['HTTP_REFERER'], '/');
  30.     if (in_array($ref$allowedOrigins)) {
  31.         $env $ref;
  32.     }
  33.     header("Access-Control-Allow-Origin: $env");
  34. }
  35. header("Access-Control-Allow-Credentials: true");
  36. header("Access-Control-Allow-Headers: origin, x-requested-with, content-type");
  37. header("Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS");
  38. /**
  39.  * Pimcore
  40.  *
  41.  * This source file is available under two different licenses:
  42.  * - GNU General Public License version 3 (GPLv3)
  43.  * - Pimcore Enterprise License (PEL)
  44.  * Full copyright and license information is available in
  45.  * LICENSE.md which is distributed with this source code.
  46.  *
  47.  * @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  48.  * @license    http://www.pimcore.org/license     GPLv3 and PEL
  49.  */
  50. use Pimcore\Tool;
  51. use Symfony\Component\HttpFoundation\Request;
  52. include __DIR__ "/../vendor/autoload.php";
  53. \Pimcore\Bootstrap::setProjectRoot();
  54. \Pimcore\Bootstrap::bootstrap();
  55. $request Request::createFromGlobals();
  56. // set current request as property on tool as there's no
  57. // request stack available yet
  58. Tool::setCurrentRequest($request);
  59. /** @var \Pimcore\Kernel $kernel */
  60. $kernel \Pimcore\Bootstrap::kernel();
  61. // reset current request - will be read from request stack from now on
  62. Tool::setCurrentRequest(null);
  63. $response $kernel->handle($request);
  64. $response->send();
  65. $kernel->terminate($request$response);