<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>westworld: a webmasters best friend &#187; autoload exception</title>
	<atom:link href="http://www.westworld.be/tag/autoload-exception/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.westworld.be</link>
	<description>A webmasters best friend</description>
	<lastBuildDate>Tue, 22 Nov 2011 10:58:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>__autoload function</title>
		<link>http://www.westworld.be/a-note-to-self/__autoload-function/</link>
		<comments>http://www.westworld.be/a-note-to-self/__autoload-function/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 08:05:07 +0000</pubDate>
		<dc:creator>westworld</dc:creator>
				<category><![CDATA[a note to self]]></category>
		<category><![CDATA[autoload exception]]></category>

		<guid isPermaLink="false">http://www.westworld.be/?p=108</guid>
		<description><![CDATA[<a href="http://www.westworld.be/a-note-to-self/__autoload-function/" title="__autoload function"></a>Some info,snippets on PHP5 autoload function: function __autoload($className) { include_once __autoloadFilename($className); } function __autoloadFilename($className) { return str_replace('_','/',$className).".php"; } $class = new myclass(); When a Class is not found, php will pass the classname to the __autoload function. You can name &#8230;<p class="read-more"><a href="http://www.westworld.be/a-note-to-self/__autoload-function/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.westworld.be/a-note-to-self/__autoload-function/" title="__autoload function"></a><p>Some info,snippets on PHP5 autoload function:</p>
<p><code>function __autoload($className) {<br />
include_once __autoloadFilename($className);<br />
}<br />
function __autoloadFilename($className) {<br />
return str_replace('_','/',$className).".php";<br />
}<br />
$class = new myclass();</code></p>
<p>When a Class is not found, php will pass the classname to the __autoload function.<br />
You can name your class like Folder1_Folder1a_Myclass and this function will look for it in Folder1/Folder1a/Myclass.php</p>
<p>You can put multiple classes in one folder and still make this work by creating a link to the correct file.<br />
On Unix, Linux machines use the command &#8220;ln -s targetfile.php nonexistingclassfile.php&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.westworld.be/a-note-to-self/__autoload-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.westworld.be @ 2012-02-06 09:27:28 -->
