2018-10-07 03:36:19 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
2018-10-09 19:39:09 -05:00
|
|
|
// PROJECT_ROOTDIR_NAME --> ABSOLUTE_PATH_TO_PROJECT_DIR
|
|
|
|
// Return the absolute path to the project's root.
|
|
|
|
function get_project_root()
|
|
|
|
{
|
2024-02-14 21:50:41 -06:00
|
|
|
return preg_replace("%" . $GLOBALS["root"] . ".*" . "%",
|
|
|
|
$GLOBALS["root"] . "/",
|
2018-10-09 19:39:09 -05:00
|
|
|
getcwd());
|
|
|
|
}
|
|
|
|
|
|
|
|
// PATH_RELATIVE_TO_PROJECT_ROOT --> ABSOLUTE_PATH
|
|
|
|
// Return the absolute path to something within the project's root.
|
|
|
|
function root($path)
|
|
|
|
{
|
|
|
|
$absolute_path = get_project_root() . $path;
|
|
|
|
return $absolute_path;
|
|
|
|
}
|
|
|
|
|
2019-02-14 19:20:06 -06:00
|
|
|
// PATH_RELATIVE_TO_PROJECT_ROOT --> PATH_RELATIVE_TO_WEB_ROOT
|
|
|
|
// Return the absolute path to something within the project's root.
|
|
|
|
function webroot($path)
|
|
|
|
{
|
|
|
|
return $GLOBALS['webroot'] . $path;
|
|
|
|
}
|
|
|
|
|
2019-02-14 09:39:29 -06:00
|
|
|
include(root("res/library/array.php"));
|
|
|
|
include(root("res/library/file.php"));
|
|
|
|
include(root("res/library/insert-coin.php"));
|
|
|
|
include(root("res/library/sanitization.php"));
|
|
|
|
include(root("res/library/string.php"));
|
|
|
|
include(root("res/library/urls.php"));
|
2018-10-07 03:36:19 -05:00
|
|
|
|
|
|
|
?>
|