Voodoo\Core\Env::getApplicationBaseDir PHP Method

getApplicationBaseDir() public static method

Get the running application's base dir, usually the root where index.php is being run
public static getApplicationBaseDir ( ) : string
return string
    public static function getApplicationBaseDir()
    {
        return str_replace("\\", "/", pathinfo($_SERVER["SCRIPT_NAME"], PATHINFO_DIRNAME));
    }

Usage Example

Example #1
0
 /**
  * Return the root dir relative to the Application dir
  * Use it to include files, or get relative path of file
  * @return string
  */
 public function getBaseDir()
 {
     return Env::getApplicationBaseDir();
 }