mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-29 14:35:18 -04:00
More refactorings.
This commit is contained in:
parent
fc8a0589dd
commit
c40fac67d0
9 changed files with 279 additions and 332 deletions
|
@ -1,10 +1,14 @@
|
|||
<?php
|
||||
|
||||
function normalize_path($path, $trailing_slash = false) {
|
||||
|
||||
$path = preg_replace("#\\+|/+#", "/", $path);
|
||||
return preg_match("#^(\w:)?/$#", $path) ? $path : (rtrim($path, "/") . ($trailing_slash ? "/" : ""));
|
||||
}
|
||||
|
||||
function normalized_require_once($lib) {
|
||||
|
||||
$path = dirname(__FILE__) . "/inc/" . $lib;
|
||||
$path = preg_replace("#\\+|/+#", "/", $path);
|
||||
require_once($path);
|
||||
require_once(normalize_path(dirname(__FILE__) . "/inc/" . $lib, false));
|
||||
}
|
||||
|
||||
normalized_require_once("main.php");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue