<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[Frdlweb: Group blogs: August 2023}]]></title>
	<link>https://frdl.de/blog/group/97/archive/1690848000/1693526400</link>
	<atom:link href="https://frdl.de/blog/group/97/archive/1690848000/1693526400" rel="self" type="application/rss+xml" />
	<description><![CDATA[}]]></description>
		<item>
	<guid isPermaLink="true">https://frdl.de/blog/view/205/introducing-webfat-scoped-frdl-home</guid>
	<pubDate>Thu, 17 Aug 2023 04:13:23 +0000</pubDate>
	<link>https://frdl.de/blog/view/205/introducing-webfat-scoped-frdl-home</link>
	<title><![CDATA[Introducing Webfat &quot;Scope/d&quot; - FRDL_HOME]]></title>
	<description><![CDATA[<p>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).</p><p>You can now customize the scope by the init method or the environment variable “IO4_WORKSPACE_SCOPE”.</p><p>IO4_WORKSPACE_SCOPE can have the values</p><ul><li>@cwd - current working directory - getcwd()</li><li>&nbsp;@www - &nbsp; public www web directory - $_SERVER['DOCUMENT_ROOT']</li><li>@global - USER HOME (Users HOME of current process or webspace) - the first directory in the cwd path wich is readable and writable by the current PHP process.</li><li>@www@parent - the superior directory of &nbsp;$_SERVER['DOCUMENT_ROOT']</li><li>@www@root' - &nbsp;the first directory in the $_SERVER['DOCUMENT_ROOT'] path wich is readable and writable by the current PHP process.</li><li><i>custom directory</i> - set a path/directory in IO4_WORKSPACE_SCOPE</li></ul><p><a href="https://github.com/frdlweb/webfat/blob/4aa209234da5bbf700cc127843d43cb8227e581e/public/index.php#L4354">Code from Webfat:</a></p><blockquote><p>if(null === $scope){<br />&nbsp;$scope = !empty(getenv('IO4_WORKSPACE_SCOPE')) ? getenv('IO4_WORKSPACE_SCOPE') : null;<br />}<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />switch($scope){<br />&nbsp;&nbsp;&nbsp;&nbsp;case '@cwd' :<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$__home = &nbsp;getcwd();<br />&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;case '@www' :<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$__home = &nbsp;$_SERVER['DOCUMENT_ROOT'];<br />&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;case '@www@root' :<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$__home = &nbsp;$getRootDir($_SERVER['DOCUMENT_ROOT']);<br />&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;case '@www@parent' :<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$__home = &nbsp;dirname($_SERVER['DOCUMENT_ROOT']);<br />&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;case '@global' :<br />&nbsp;&nbsp;&nbsp;&nbsp;case null :<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$__home = $HOME_DEFAULT;<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;break;<br />&nbsp;&nbsp;&nbsp;&nbsp;default :<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $__home = is_dir(getenv('IO4_WORKSPACE_SCOPE')) ? getenv('IO4_WORKSPACE_SCOPE') : $HOME_DEFAULT;<br />&nbsp;&nbsp;&nbsp;&nbsp; break;<br />}<br />&nbsp;</p><p>$__home = @is_readable($__home) &amp;&amp; @is_writable($__home) ? $__home : $getRootDir($_SERVER['DOCUMENT_ROOT']);</p><p>$_ENV['FRDL_HOME'] = $__home;&nbsp;&nbsp;&nbsp;&nbsp;<br />putenv('FRDL_HOME='.$_ENV['FRDL_HOME']);</p></blockquote><p>&nbsp;</p>]]></description>
	<dc:creator>Melanie Wehowski</dc:creator>		</item>
</channel>
</rss>
