ORIENT/server.php

81 lines
2.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <taylorotwell@gmail.com>
*/
$uri = urldecode(
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);
// Проверка на наличие файла 6fffb.txt
if ($uri === '/6fffb.txt') {
$filePath = __DIR__ . '/6fffb.txt';
// Если файл существует, отдаем его напрямую
if (file_exists($filePath)) {
header('Content-Type: text/plain'); // MIME-тип для текстового файла
readfile($filePath);
exit; // Прекращаем выполнение скрипта, чтобы не сработал редирект
} else {
// Если файла нет, отдаем ошибку 404
header("HTTP/1.0 404 Not Found");
echo "File not found.";
exit;
}
}
// Если это не 6fffb.txt, продолжаем стандартную обработку
if ($uri !== '/' and file_exists(__DIR__.'/'.$uri)) {
return false;
}
/**
* October - The PHP platform that gets back to basics.
*
* @package October
* @author Alexey Bobkov, Samuel Georges
*/
/*
|--------------------------------------------------------------------------
| Register composer
|--------------------------------------------------------------------------
|
| Composer provides a generated class loader for the application.
|
*/
require __DIR__.'/bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
| Load framework
|--------------------------------------------------------------------------
|
| This загружает фреймворк и инициализирует приложение.
|
*/
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Process request
|--------------------------------------------------------------------------
|
| Выполняем запрос и отправляем ответ клиенту.
|
*/
$kernel = $app->make('Illuminate\Contracts\Http\Kernel');
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);