123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace think;
- if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
- header("Access-Control-Allow-Credentials: true");
- header("Access-Control-Max-Age: 86400");
- header("Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS");
- header("Access-Control-Allow-Headers: " . $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']);
- header("Access-Control-Allow-Origin: *");
- exit();
- }
- $rootPath = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR;
- $server = isset($_REQUEST['server']) || isset($_SERVER['HTTP_SERVER']) || substr($_SERVER['REQUEST_URI'], 1, 9) == 'index.php';
- if (!$server) {
-
-
- if (!is_file($rootPath . 'install.lock') && is_file($rootPath . 'install' . DIRECTORY_SEPARATOR . 'index.html')) {
- header("location:" . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR);
- exit();
- }
-
-
- if (is_file($rootPath . 'index.html')) {
- header("location:" . DIRECTORY_SEPARATOR . 'index.html');
- exit();
- }
-
- }
- require __DIR__ . '/../vendor/autoload.php';
- $http = (new App())->http;
- $response = $http->run();
- $response->send();
- $http->end($response);
|