<?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: All site blogs: August 2023}]]></title>
	<link>https://frdl.de/blog/all/1693519200/1696111200</link>
	<atom:link href="https://frdl.de/blog/all/1693519200/1696111200" rel="self" type="application/rss+xml" />
	<description><![CDATA[}]]></description>
		<item>
	<guid isPermaLink="true">https://frdl.de/blog/view/247/introducing-io4webfat-facades</guid>
	<pubDate>Sun, 17 Sep 2023 03:52:10 +0000</pubDate>
	<link>https://frdl.de/blog/view/247/introducing-io4webfat-facades</link>
	<title><![CDATA[Introducing IO4/Webfat Facades]]></title>
	<description><![CDATA[<p><strong>Import shortcuts and facades into ANY namespace</strong></p><p>You can now import the <a href="https://github.com/frdlweb/webfat/blob/e1949d2d55ccb984b168e11c0a7f0262799367b6/public/index.php#L5534">facades</a> into ANY namespace.</p><p>So this works:</p><blockquote><p>&nbsp;&nbsp;&lt;?php</p><p>namespace MyNamespace1;</p><p>&nbsp;&nbsp;echo &nbsp; Helper::toUUID4() ;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo '-';&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo Config::get('appId');&nbsp;&nbsp;&nbsp;&nbsp;</p></blockquote><p>…and this works also…:</p><blockquote><p>&nbsp;&nbsp;&lt;?php</p><p>namespace MyOtherNamespace2;</p><p>&nbsp;&nbsp;echo &nbsp; Helper::toUUID4() ;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo '-';&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo Config::get('appId');&nbsp;&nbsp;&nbsp;&nbsp;</p></blockquote><p>The snippet from container-entry “script@inc.common.bootstrap” does it and it now looks like</p><blockquote><p>&lt;?php</p><p>if($container-&gt;has('config.IO4_FACADES_ENABLE') &amp;&amp; true === $container-&gt;get('config.IO4_FACADES_ENABLE')<br />&nbsp;&nbsp;&nbsp;&nbsp; &amp;&amp; $container-&gt;has('config.app.core.code.facades.$import')<br />&nbsp;&nbsp;&nbsp;&nbsp;){<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;$import = $container-&gt;get('config.app.core.code.facades.$import');<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;$container-&gt;get('app.runtime.stubrunner')-&gt;withFacades(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; $import['baseName'],&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; $import['namespace']&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;);<br />&nbsp;}&nbsp;</p></blockquote><p>It uses the “<a href="https://github.com/johnstevenson/statical">statical library</a>”.</p>]]></description>
	<dc:creator>Melanie Wehowski</dc:creator>		</item>
</channel>
</rss>
