1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect1 id="learning.autoloading.intro">
4 <title>Introduction</title>
7 Autoloading is a mechanism that eliminates the need to manually require dependencies within
8 your <acronym>PHP</acronym> code. Per <ulink url="http://php.net/autoload">the PHP
9 autoload manual</ulink>, once an autoloader has been defined, it "is automatically called
10 in case you are trying to use a class or an interface which hasn't been defined yet."
14 Using autoloading, you do not need to worry about <emphasis>where</emphasis> a class exists
15 in your project. With well-defined autoloaders, you do not need to worry about where a class
16 file is relative to the current class file; you simply use the class, and the autoloader
17 will perform the file lookup.
21 Additionally, autoloading, because it defers loading to the last possible moment and ensures
22 that a match only has to occur once, can be a huge performance boost -- particularly if you
23 take the time to strip out <methodname>require_once()</methodname> calls before you move
28 Zend Framework encourages the use of autoloading, and provides several tools to provide
29 autoloading of both library code as well as application code. This tutorial covers these
30 tools, as well as how to use them effectively.