public/index.php line 41

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. header('Access-Control-Allow-Origin: *'); 
  15. header("Access-Control-Allow-Credentials: true");
  16. header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
  17. header('Access-Control-Max-Age: 1000');
  18. header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token , Authorization');
  19. use Pimcore\Tool;
  20. use Symfony\Component\HttpFoundation\Request;
  21. include __DIR__ "/../vendor/autoload.php";
  22. \Pimcore\Bootstrap::setProjectRoot();
  23. \Pimcore\Bootstrap::bootstrap();
  24. $request Request::createFromGlobals();
  25. // set current request as property on tool as there's no
  26. // request stack available yet
  27. Tool::setCurrentRequest($request);
  28. /** @var \Pimcore\Kernel $kernel */
  29. $kernel \Pimcore\Bootstrap::kernel();
  30. // reset current request - will be read from request stack from now on
  31. Tool::setCurrentRequest(null);
  32. $response $kernel->handle($request);
  33. $response->send();
  34. $kernel->terminate($request$response);