generated from biurad/php-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.php
30 lines (26 loc) · 893 Bytes
/
server.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php declare(strict_types=1);
/*
* This file is part of Flange Blog Demo Project
*
* @copyright 2022 Divine Niiquaye Ibok (https://divinenii.com/)
* @license https://opensource.org/licenses/MIT License
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/*
*--------------------------------------------------------------------------
* Cli & CGI WebServer Booting
*-------------------------------------------------------------------------
*
* Decline static file requests back to the PHP built-in web-server
*
*/
if (\in_array(\PHP_SAPI, ['cli-server', 'cgi-fcgi'], true)) {
$path = \realpath(__DIR__.\parse_url($_SERVER['REQUEST_URI'], \PHP_URL_PATH));
if (__FILE__ !== $path && \is_file((string) $path)) {
return false;
}
unset($path);
}
require __DIR__.'/public/index.php';