make sure even Windows can run our dev server....
This commit is contained in:
parent
4e128da70f
commit
93b2c01961
|
@ -39,7 +39,7 @@ $hosted_local_patterns[] = '/^\favicon.*/';
|
|||
foreach ($hosted_local_patterns as $pattern) {
|
||||
if (preg_match($pattern, $uri)) {
|
||||
if (strpos($uri, '/ui/') === 0) {
|
||||
$path = __DIR__ . substr($uri, 3);
|
||||
$path = $_SERVER['DOCUMENT_ROOT'] . substr($uri, 3);
|
||||
if (is_file($path)) {
|
||||
$tmp_ext = explode('.', strtolower($path));
|
||||
$mimeTypes = [
|
||||
|
@ -70,6 +70,11 @@ session_start();
|
|||
$_SESSION["Username"]="root";
|
||||
session_write_close();
|
||||
|
||||
if (PHP_OS == 'WINNT') {
|
||||
// Windows doesn't know syslog facility LOCAL4
|
||||
define("LOG_LOCAL4", LOG_USER);
|
||||
}
|
||||
|
||||
if (preg_match("/^\/ui\/.*/", $uri)) {
|
||||
$_GET['_url'] = substr($_SERVER['REQUEST_URI'], 3);
|
||||
require_once "{$DEV_WORKDIR}/stubs/index.php";
|
||||
|
|
|
@ -63,7 +63,12 @@ $run_command[] = "-S localhost:8000";
|
|||
$run_command[] = str_replace('//', '/', "-t {$config->environment->coreDir}/src/opnsense/www");
|
||||
|
||||
// .htaccess alternative routing
|
||||
$run_command[] = ".htrouter.php";
|
||||
if (PHP_OS == 'WINNT') {
|
||||
// for some reason, the windows version of the php local webserver expects the file location in it's current path
|
||||
$run_command[] = "public\\.htrouter.php";
|
||||
} else {
|
||||
$run_command[] = ".htrouter.php";
|
||||
}
|
||||
|
||||
// set our working directory in the php environment in which the server runs
|
||||
putenv("DEV_WORKDIR=".__DIR__);
|
||||
|
|
Loading…
Reference in New Issue