Skip to content

Commit 8d3916f

Browse files
committed
Use only 'require', prepend __DIR__ to server files (avoid conficts) and add keys to paths ordering
1 parent ff719ab commit 8d3916f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
/**
5757
* @var array Server config
5858
*/
59-
$config = require_once 'server_config.php';
59+
$config = require __DIR__ . '/server_config.php';
6060

6161
$ini = '';
6262
foreach ($config['ini'] as $key => $value)

src/server_router.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
*/
1010

1111
// Load our functions...
12-
require_once 'functions.php';
12+
require __DIR__ . '/functions.php';
1313

1414
/**
1515
* @var array Server config
1616
*/
17-
$config = require_once 'server_config.php';
17+
$config = require __DIR__ . '/server_config.php';
1818

1919
error_reporting($config['error_reporting']);
2020

@@ -84,7 +84,7 @@
8484
$title = 'Error 404';
8585
$page = 'error-404';
8686

87-
require_once __DIR__ . '/pages/_template.php';
87+
require __DIR__ . '/pages/_template.php';
8888

8989
$function_clean_vars();
9090

@@ -117,7 +117,7 @@
117117
$fi = new FilesystemIterator($SplFileInfo->getRealPath());
118118
}
119119

120-
$paths[] = [
120+
$paths[$pathname] = [
121121
'type' => $SplFileInfo->getType(),
122122
'realPath' => $SplFileInfo->getRealPath(),
123123
'filename' => $SplFileInfo->getFilename(),
@@ -137,6 +137,6 @@
137137

138138
$page = 'default';
139139

140-
require_once __DIR__ . '/pages/_template.php';
140+
require __DIR__ . '/pages/_template.php';
141141

142142
$function_clean_vars();

0 commit comments

Comments
 (0)