insert-coin/res/library/main.php

36 lines
928 B
PHP
Raw Permalink Normal View History

<?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()
{
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;
}
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"));
?>