Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F203
Nasqueron_Tools_—_Router_script_to_use_built-in_PHP_server
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
dereckson
Nov 23 2014, 11:15
2014-11-23 11:15:10 (UTC+0)
Size
726 B
Referenced Files
None
Subscribers
None
Nasqueron_Tools_—_Router_script_to_use_built-in_PHP_server
View Options
<?php
/**
* Nasqueron Tools
*
* Router script to use built-in PHP server
*
* @package NasqueronTools
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @filesource
*
*/
$requestedFile
=
substr
(
$_SERVER
[
"REQUEST_URI"
],
1
);
if
(
array_key_exists
(
'QUERY_STRING'
,
$_SERVER
))
{
$len
=
strlen
(
$_SERVER
[
'QUERY_STRING'
])
+
1
;
$requestedFile
=
substr
(
$requestedFile
,
0
,
$len
*
-
1
);
}
if
(
file_exists
(
$requestedFile
)
&&
!
is_dir
(
$requestedFile
))
{
return
false
;
}
if
(
file_exists
(
"$requestedFile.php"
))
{
$requestedFile
.=
'.php'
;
}
$_SERVER
[
'PATH_INFO'
]
=
'/'
.
$requestedFile
;
require
'index.php'
;
exit
;
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
198
Default Alt Text
Nasqueron_Tools_—_Router_script_to_use_built-in_PHP_server (726 B)
Attached To
Mode
P10 Nasqueron Tools — Router script to use built-in PHP server
Attached
Detach File
Event Timeline
Log In to Comment