-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpserver.php
37 lines (35 loc) · 828 Bytes
/
phpserver.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
31
32
33
34
35
36
37
<?php
/**
* Fuel is a fast, lightweight, community driven PHP 5.4+ framework.
*
* @package Fuel
* @version 1.9-dev
* @author Fuel Development Team
* @license MIT License
* @copyright 2010 - 2019 Fuel Development Team
* @link https://fuelphp.com
*/
// determine the file we're loading, we need to strip the query string for that
if (isset($_SERVER['SCRIPT_NAME']))
{
$file = $_SERVER['DOCUMENT_ROOT'].$_SERVER['SCRIPT_NAME'];
}
else
{
$file = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];
if (($pos = strpos($file, '?')) !== false)
{
$file = substr($file, 0, $pos);
}
}
if (file_exists($file))
{
// bypass existing file processing
return false;
}
else
{
// route requests though the normal path
$_SERVER['SCRIPT_NAME'] = __FILE__;
include $_SERVER['DOCUMENT_ROOT'].'/index.php';
}