You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Application-Web/public/utils.php

16 lines
410 B

<?php
/**
* relative path of the public directory from the server's document root.
*/
function get_public_path() {
// find the server path of the index.php file
$basePath = substr(__DIR__, strlen($_SERVER['DOCUMENT_ROOT']));
$c = $basePath[strlen($basePath) - 1];
if ($c == "/" || $c == "\\") {
$basePath = substr($basePath, 0, strlen($basePath) - 1);
}
return $basePath;
}