The environment variable “FRDL_HOME” defines the global root directory of the frdl-context (the directory where the apps global scope lives in, different to the public www webdirectory).
You can now customize the scope by the init method or the environment variable “IO4_WORKSPACE_SCOPE”.
IO4_WORKSPACE_SCOPE can have the values
if(null === $scope){
$scope = !empty(getenv('IO4_WORKSPACE_SCOPE')) ? getenv('IO4_WORKSPACE_SCOPE') : null;
}
switch($scope){
case '@cwd' :
$__home = getcwd();
break;
case '@www' :
$__home = $_SERVER['DOCUMENT_ROOT'];
break;
case '@www@root' :
$__home = $getRootDir($_SERVER['DOCUMENT_ROOT']);
break;
case '@www@parent' :
$__home = dirname($_SERVER['DOCUMENT_ROOT']);
break;
case '@global' :
case null :
$__home = $HOME_DEFAULT;
break;
default :
$__home = is_dir(getenv('IO4_WORKSPACE_SCOPE')) ? getenv('IO4_WORKSPACE_SCOPE') : $HOME_DEFAULT;
break;
}
$__home = @is_readable($__home) && @is_writable($__home) ? $__home : $getRootDir($_SERVER['DOCUMENT_ROOT']);
$_ENV['FRDL_HOME'] = $__home;
putenv('FRDL_HOME='.$_ENV['FRDL_HOME']);
Comments
+ Added .env file support for configuring scope: https://github.com/frdlweb/webfat/blob/0d925efcef0198b81d27fa25e1437c458bcccc2f/public/index.php#L4354