insert-coin/res/library/main.php
Jaidyn Ann 75b782f5bd Re-add variable typo
… so that I can merge shreyasminocha’s PR, so they
get their commit in after so long. They apparently
noticed the type long before me, after all.
2024-02-14 22:08:55 -06:00

36 lines
928 B
PHP

<?php
// PROJECT_ROOTDIR_NAME --> ABSOLUTE_PATH_TO_PROJECT_DIR
// Return the absolute path to the project's root.
function get_project_root()
{
return preg_replace("%" . $GLOBALS["root_name"] . ".*" . "%",
$GLOBALS["root_name"] . "/",
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;
}
// 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;
}
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"));
?>