function internalRequestURI() : string { $requestUri = currentUri() ? str_replace(DIRECTORY_INDEX . '/', '', currentUri()) : substr(server('currentPath'), 1); if (isset($requestUri[strlen($requestUri) - 1]) && $requestUri[strlen($requestUri) - 1] === '/') { $requestUri = substr($requestUri, 0, -1); } $requestUri = internalCleanInjection(internalRouteURI($requestUri)); $requestUri = internalCleanURIPrefix($requestUri, currentLang()); if (defined('_CURRENT_PROJECT')) { $requestUri = internalCleanURIPrefix($requestUri, _CURRENT_PROJECT); } return $requestUri; }
function basePath(string $uri = '', int $index = 0) : string { $newBaseDir = substr(BASE_DIR, 1); if (BASE_DIR !== "/") { if ($index < 0) { $baseDir = substr(BASE_DIR, 1, -1); $baseDir = explode("/", $baseDir); $newBaseDir = ''; for ($i = 0; $i < count($baseDir) + $index; $i++) { $newBaseDir .= suffix($baseDir[$i]); } } } return internalCleanInjection($newBaseDir . $uri); }
function hostUrl(string $uri = '') : string { return sslStatus() . suffix(host()) . internalCleanInjection($uri); }