Zend_Loader-Autoloader.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.loader.autoloader">
  4. <title>The Autoloader</title>
  5. <para>
  6. <classname>Zend_Loader_Autoloader</classname> introduces a comprehensive
  7. autoloading solution for Zend Framework. It has been designed with
  8. several goals in mind:
  9. </para>
  10. <itemizedlist>
  11. <listitem><para>
  12. Provide a true namespace autoloader. (Previous incarnations
  13. intercepted all userland namespaces.)
  14. </para></listitem>
  15. <listitem><para>
  16. Allow registering arbitrary callbacks as autoloaders, and manage
  17. them as a stack. (At the time of this writing, this overcomes some
  18. issues with <code>spl_autoload</code>, which does not allow
  19. re-registering a callback that utilizes an instance method.)
  20. </para></listitem>
  21. <listitem><para>
  22. Allow optimistic matching of namespaces to provide faster class
  23. resolution.
  24. </para></listitem>
  25. </itemizedlist>
  26. <para>
  27. <classname>Zend_Loader_Autoloader</classname> implements a singleton, making it
  28. unversally accessible. This provides the ability to register additional
  29. autoloaders from anywhere in your code as necessary.
  30. </para>
  31. <sect2 id="zend.loader.autoloader.usage">
  32. <title>Using the Autoloader</title>
  33. <para>
  34. The first time an instance of the autoloader is retrieved, it
  35. registers itself with <code>spl_autoload</code>. You retrieve an
  36. instance using the <methodname>getInstance()</methodname> method:
  37. </para>
  38. <programlisting language="php"><![CDATA[
  39. $autoloader = Zend_Loader_Autoloader::getInstance();
  40. ]]></programlisting>
  41. <para>
  42. By default, the autoloader is configured to match the "Zend_" and
  43. "ZendX_" namespaces. If you have your own library code that uses
  44. your own namespace, you may register it with the autoloader using
  45. the <methodname>registerNamespace()</methodname> method. For instance, if your
  46. library code is prefixed with "My_", you could do so as follows:
  47. </para>
  48. <programlisting language="php"><![CDATA[
  49. $autoloader->registerNamespace('My_');
  50. ]]></programlisting>
  51. <note>
  52. <title>Namespace Prefixes</title>
  53. <para>
  54. You'll note that the previous example uses "My_" and not "My".
  55. This is because <classname>Zend_Loader_Autoloader</classname> is intended
  56. as a general purpose autoloader, and does not make the
  57. assumption that a given class prefix namespace includes an
  58. underscore. If your class namespace <emphasis>does</emphasis>
  59. include one, you should include it when registering your
  60. namespace.
  61. </para>
  62. </note>
  63. <para>
  64. You can also register arbitrary autoloader callbacks, optionally
  65. with a specific namespace (or group of namespaces).
  66. <classname>Zend_Loader_Autoloader</classname> will attempt to match these
  67. first before using its internal autoloading mechanism.
  68. </para>
  69. <para>
  70. As an example, you may want to utilize one or more eZcomponents
  71. components with your Zend Framework application. To use its
  72. autoloading capabilities, push it onto the autoloader stack using
  73. <methodname>pushAutoloader()</methodname>:
  74. </para>
  75. <programlisting language="php"><![CDATA[
  76. $autoloader->pushAutoloader(array('ezcBase', 'autoload'), 'ezc');
  77. ]]></programlisting>
  78. <para>
  79. This tells the autoloader to use the eZcomponents autoloader for
  80. classes beginning with "ezc".
  81. </para>
  82. <para>
  83. You can use the <methodname>unshiftAutoloader()</methodname> method to add the
  84. autoloader to the beginning of the autoloader chain.
  85. </para>
  86. <para>
  87. By default, <classname>Zend_Loader_Autoloader</classname> does no error
  88. suppression when using its internal autoloader, which utilizes
  89. <methodname>Zend_Loader::loadClass()</methodname>. Most of the time, this is
  90. exactly what you want. However, there may be cases where you want to
  91. suppress them. You can do this using
  92. <methodname>suppressNotFoundWarnings()</methodname>:
  93. </para>
  94. <programlisting language="php"><![CDATA[
  95. $autoloader->suppressNotFoundWarnings(true);
  96. ]]></programlisting>
  97. <para>
  98. Finally, there may be times when you want the autoloader to load any
  99. namespace. For instance, PEAR libraries do not share a common
  100. namespace, making specifying individual namespaces difficult when
  101. many PEAR components are in use. You can use the
  102. <methodname>setFallbackAutoloader()</methodname> method to have the autoloader
  103. act as a catch-all:
  104. </para>
  105. <programlisting language="php"><![CDATA[
  106. $autoloader->setFallbackAutoloader(true);
  107. ]]></programlisting>
  108. <note>
  109. <title>Loading Classes from PHP Namespaces</title>
  110. <para>
  111. Starting in version 1.10.0, Zend Framework now allows loading classes from PHP
  112. namespaces. This support follows the same guidelines and implementation as that
  113. found in the <ulink
  114. url="http://groups.google.com/group/php-standards/web/psr-0-final-proposal">PHP
  115. Framework Interop Group PSR-0</ulink> reference implementation.
  116. </para>
  117. <para>
  118. Under this guideline, the following rules apply:
  119. </para>
  120. <itemizedlist>
  121. <listitem>
  122. <para>
  123. Each namespace separator is converted to a
  124. <constant>DIRECTORY_SEPARATOR</constant> when loading from the file system.
  125. </para>
  126. </listitem>
  127. <listitem>
  128. <para>
  129. Each "_" character in the <emphasis>CLASS NAME</emphasis> is converted to a
  130. <constant>DIRECTORY_SEPARATOR</constant>. The "_" character has no special
  131. meaning in the namespace.
  132. </para>
  133. </listitem>
  134. <listitem>
  135. <para>
  136. The fully-qualified namespace and class is suffixed with ".php" when loading
  137. from the file system.
  138. </para>
  139. </listitem>
  140. </itemizedlist>
  141. <para>
  142. As examples:
  143. </para>
  144. <itemizedlist>
  145. <listitem>
  146. <para>
  147. <classname>\Doctrine\Common\IsolatedClassLoader</classname> =&gt;
  148. <filename>/path/to/project/lib/vendor/Doctrine/Common/IsolatedClassLoader.php</filename>
  149. </para>
  150. </listitem>
  151. <listitem>
  152. <para>
  153. <classname>\namespace\package\Class_Name</classname> =&gt;
  154. <filename>/path/to/project/lib/vendor/namespace/package/Class/Name.php</filename>
  155. </para>
  156. </listitem>
  157. <listitem>
  158. <para>
  159. <classname>\namespace\package_name\Class_Name</classname> =&gt;
  160. <filename>/path/to/project/lib/vendor/namespace/package_name/Class/Name.php</filename>
  161. </para>
  162. </listitem>
  163. </itemizedlist>
  164. </note>
  165. </sect2>
  166. <sect2 id="zend.loader.autoloader.zf-version">
  167. <title>Selecting a Zend Framework version</title>
  168. <para>
  169. Typically, you will use the version of Zend Framework that the autoloader you
  170. instantiate came with. However, when developing a project, it's often useful to track
  171. specific versions, major or minor branches, or just the latest version.
  172. <classname>Zend_Loader_Autoloader</classname>, as of version 1.10, offers some features
  173. to help manage this task.
  174. </para>
  175. <para>
  176. Imagine the following scenario:
  177. </para>
  178. <itemizedlist>
  179. <listitem>
  180. <para>
  181. During <emphasis>development</emphasis>, you want to track the latest version of
  182. Zend Framework you have installed, so that you can ensure the application works
  183. when you upgrade between versions.
  184. </para>
  185. <para>
  186. When pushing to <emphasis>Quality Assurance</emphasis>, however, you need to
  187. have slightly more stability, so you want to use the latest installed revision
  188. of a specific minor version.
  189. </para>
  190. <para>
  191. Finally, when you push to <emphasis>production</emphasis>, you want to pin to a
  192. specific installed version, to ensure no breakage occurs if or when you add new
  193. versions of Zend Framework to you server.
  194. </para>
  195. </listitem>
  196. </itemizedlist>
  197. <para>
  198. The autoloader allows you to do this with the method
  199. <methodname>setZfPath()</methodname>. This method takes two arguments, a
  200. <emphasis>path</emphasis> to a set of Zend Framework installations, and a
  201. <emphasis>version</emphasis> to use. Once invoked, it prepends a path to the
  202. <constant>include_path</constant> pointing to the appropriate Zend Framework
  203. installation library.
  204. </para>
  205. <para>
  206. The directory you specify as your <emphasis>path</emphasis> should have a tree such as
  207. the following:
  208. </para>
  209. <programlisting language="text"><![CDATA[
  210. ZendFramework/
  211. |-- 1.9.2/
  212. | |-- library/
  213. |-- ZendFramework-1.9.1-minimal/
  214. | |-- library/
  215. |-- 1.8.4PL1/
  216. | |-- library/
  217. |-- 1.8.4/
  218. | |-- library/
  219. |-- ZendFramework-1.8.3/
  220. | |-- library/
  221. |-- 1.7.8/
  222. | |-- library/
  223. |-- 1.7.7/
  224. | |-- library/
  225. |-- 1.7.6/
  226. | |-- library/
  227. ]]></programlisting>
  228. <para>
  229. (where <emphasis>path</emphasis> points to the directory "ZendFramework" in the above
  230. example)
  231. </para>
  232. <para>
  233. Note that each subdirectory should contain the directory <filename>library</filename>,
  234. which contains the actual Zend Framework library code. The individual subdirectory names
  235. may be version numbers, or simply be the untarred contents of a standard Zend Framework
  236. distribution tarball/zipfile.
  237. </para>
  238. <para>
  239. Now, let's address the use cases. In the first use case, in
  240. <emphasis>development</emphasis>, we want to track the latest source install. We can do
  241. that by passing "latest" as the version:
  242. </para>
  243. <programlisting language="php"><![CDATA[
  244. $autoloader->setZfPath($path, 'latest');
  245. ]]></programlisting>
  246. <para>
  247. In the example from above, this will map to the directory
  248. <filename>ZendFramework/1.9.2/library/</filename>; you can verify this by checking the
  249. return value of <methodname>getZfPath()</methodname>.
  250. </para>
  251. <para>
  252. In the second situation, for <emphasis>quality assurance</emphasis>, let's say we want
  253. to pin to the 1.8 minor release, using the latest install you have for that release. You
  254. can do so as follows:
  255. </para>
  256. <programlisting language="php"><![CDATA[
  257. $autoloader->setZfPath($path, '1.8');
  258. ]]></programlisting>
  259. <para>
  260. In this case, it will find the directory
  261. <filename>ZendFramework/1.8.4PL1/library/</filename>.
  262. </para>
  263. <para>
  264. In the final case, for <emphasis>production</emphasis>, we'll pin to a specific version
  265. -- 1.7.7, since that was what was available when Quality Assurance tested prior to our
  266. release.
  267. </para>
  268. <programlisting language="php"><![CDATA[
  269. $autoloader->setZfPath($path, '1.7.7');
  270. ]]></programlisting>
  271. <para>
  272. Predictably, it finds the directory <filename>ZendFramework/1.7.7/library/</filename>.
  273. </para>
  274. <para>
  275. You can also specify these values in the configuration file you use with
  276. <filename>Zend_Application</filename>. To do so, you'd specify the following
  277. information:
  278. </para>
  279. <programlisting language="ini"><![CDATA[
  280. [production]
  281. autoloaderZfPath = "path/to/ZendFramework"
  282. autoloaderZfVersion = "1.7.7"
  283. [qa]
  284. autoloaderZfVersion = "1.8"
  285. [development]
  286. autoloaderZfVersion = "latest"
  287. ]]></programlisting>
  288. <para>
  289. Note the different environment sections, and the different version specified in each
  290. environment; these factors will allow <classname>Zend_Application</classname> to
  291. configure the autoloader appropriately.
  292. </para>
  293. <warning>
  294. <title>Performance implications</title>
  295. <para>
  296. For best performance, either do not use this feature, or specify a specific Zend
  297. Framework version (i.e., not "latest", a major revision such as "1", or a minor
  298. revision such as "1.8"). Otherwise, the autoloader will need to scan the provided
  299. path for directories matching the criteria -- a somewhat expensive operation to
  300. perform on each request.
  301. </para>
  302. </warning>
  303. </sect2>
  304. <sect2 id="zend.loader.autoloader.interface">
  305. <title>The Autoloader Interface</title>
  306. <para>
  307. Besides being able to specify arbitrary callbacks as autoloaders,
  308. Zend Framework also defines an interface autoloading classes may
  309. imlement, <classname>Zend_Loader_Autoloader_Interface</classname>:
  310. </para>
  311. <programlisting language="php"><![CDATA[
  312. interface Zend_Loader_Autoloader_Interface
  313. {
  314. public function autoload($class);
  315. }
  316. ]]></programlisting>
  317. <para>
  318. When using this interface, you can simply pass a class instance to
  319. <classname>Zend_Loader_Autoloader</classname>'s <methodname>pushAutoloader()</methodname>
  320. and <methodname>unshiftAutoloader()</methodname> methods:
  321. </para>
  322. <programlisting language="php"><![CDATA[
  323. // Assume Foo_Autoloader implements Zend_Loader_Autoloader_Interface:
  324. $foo = new Foo_Autoloader();
  325. $autoloader->pushAutoloader($foo, 'Foo_');
  326. ]]></programlisting>
  327. </sect2>
  328. <sect2 id="zend.loader.autoloader.reference">
  329. <title>Autoloader Reference</title>
  330. <para>
  331. Below, please find a guide to the methods available in
  332. <classname>Zend_Loader_Autoloader</classname>.
  333. </para>
  334. <table id="zend.loader.autoloader.reference.api">
  335. <title>Zend_Loader_Autoloader Methods</title>
  336. <tgroup cols="4">
  337. <thead>
  338. <row>
  339. <entry>Method</entry>
  340. <entry>Return Value</entry>
  341. <entry>Parameters</entry>
  342. <entry>Description</entry>
  343. </row>
  344. </thead>
  345. <tbody>
  346. <row>
  347. <entry><methodname>getInstance()</methodname></entry>
  348. <entry><classname>Zend_Loader_Autoloader</classname></entry>
  349. <entry>N/A</entry>
  350. <entry><para>
  351. Retrieve the <classname>Zend_Loader_Autoloader</classname>
  352. singleton instance. On first retrieval, it registers
  353. itself with <code>spl_autoload</code>. This method
  354. is static.
  355. </para></entry>
  356. </row>
  357. <row>
  358. <entry><methodname>resetInstance()</methodname></entry>
  359. <entry><code>void</code></entry>
  360. <entry>N/A</entry>
  361. <entry><para>
  362. Resets the state of the <classname>Zend_Loader_Autoloader</classname>
  363. singleton instance to it's original state,
  364. unregistering all autoloader callbacks and all
  365. registered namespaces.
  366. </para></entry>
  367. </row>
  368. <row>
  369. <entry><methodname>autoload($class)</methodname></entry>
  370. <entry><code>string|<constant>FALSE</constant></code></entry>
  371. <entry><itemizedlist>
  372. <listitem><para>
  373. <varname>$class</varname>, <emphasis>required</emphasis>.
  374. A string class name to load.
  375. </para></listitem>
  376. </itemizedlist></entry>
  377. <entry><para>
  378. Attempt to resolve a class name to a file and load
  379. it.
  380. </para></entry>
  381. </row>
  382. <row>
  383. <entry><methodname>setDefaultAutoloader($callback)</methodname></entry>
  384. <entry><classname>Zend_Loader_Autoloader</classname></entry>
  385. <entry><itemizedlist>
  386. <listitem><para>
  387. <varname>$callback</varname>, <emphasis>required</emphasis>.
  388. </para></listitem>
  389. </itemizedlist></entry>
  390. <entry><para>
  391. Specify an alternate <acronym>PHP</acronym> callback to use for the
  392. default autoloader implementation.
  393. </para></entry>
  394. </row>
  395. <row>
  396. <entry><methodname>getDefaultAutoloader()</methodname></entry>
  397. <entry><code>callback</code></entry>
  398. <entry>N/A</entry>
  399. <entry><para>
  400. Retrieve the default autoloader implementation; by
  401. default, this is
  402. <methodname>Zend_Loader::loadClass()</methodname>.
  403. </para></entry>
  404. </row>
  405. <row>
  406. <entry><methodname>setAutoloaders(array $autoloaders)</methodname></entry>
  407. <entry><classname>Zend_Loader_Autoloader</classname></entry>
  408. <entry><itemizedlist>
  409. <listitem><para>
  410. <varname>$autoloaders</varname>, <emphasis>required</emphasis>.
  411. </para></listitem>
  412. </itemizedlist></entry>
  413. <entry><para>
  414. Set a list of concrete autoloaders to use in the
  415. autoloader stack. Each item in the autoloaders array
  416. must be a <acronym>PHP</acronym> callback.
  417. </para></entry>
  418. </row>
  419. <row>
  420. <entry><methodname>getAutoloaders()</methodname></entry>
  421. <entry><type>Array</type></entry>
  422. <entry>N/A</entry>
  423. <entry><para>
  424. Retrieve the internal autoloader stack.
  425. </para></entry>
  426. </row>
  427. <row>
  428. <entry><methodname>getNamespaceAutoloaders($namespace)</methodname></entry>
  429. <entry><type>Array</type></entry>
  430. <entry><itemizedlist>
  431. <listitem><para>
  432. <varname>$namespace</varname>, <emphasis>required</emphasis>
  433. </para></listitem>
  434. </itemizedlist></entry>
  435. <entry><para>
  436. Fetch all autoloaders that have registered to load a
  437. specific namespace.
  438. </para></entry>
  439. </row>
  440. <row>
  441. <entry><methodname>registerNamespace($namespace)</methodname></entry>
  442. <entry><classname>Zend_Loader_Autoloader</classname></entry>
  443. <entry><itemizedlist>
  444. <listitem><para>
  445. <varname>$namespace</varname>, <emphasis>required</emphasis>.
  446. </para></listitem>
  447. </itemizedlist></entry>
  448. <entry><para>
  449. Register one or more namespaces with the default
  450. autoloader. If <varname>$namespace</varname> is a string,
  451. it registers that namespace; if it's an array of
  452. strings, registers each as a namespace.
  453. </para></entry>
  454. </row>
  455. <row>
  456. <entry><methodname>unregisterNamespace($namespace)</methodname></entry>
  457. <entry><classname>Zend_Loader_Autoloader</classname></entry>
  458. <entry><itemizedlist>
  459. <listitem><para>
  460. <varname>$namespace</varname>, <emphasis>required</emphasis>.
  461. </para></listitem>
  462. </itemizedlist></entry>
  463. <entry><para>
  464. Unregister one or more namespaces from the default
  465. autoloader. If <varname>$namespace</varname> is a string,
  466. it unregisters that namespace; if it's an array of
  467. strings, unregisters each as a namespace.
  468. </para></entry>
  469. </row>
  470. <row>
  471. <entry><methodname>getRegisteredNamespaces()</methodname></entry>
  472. <entry><type>Array</type></entry>
  473. <entry>N/A</entry>
  474. <entry><para>
  475. Returns an array of all namespaces registered with
  476. the default autoloader.
  477. </para></entry>
  478. </row>
  479. <row>
  480. <entry><methodname>suppressNotFoundWarnings($flag = null)</methodname></entry>
  481. <entry><code>boolean|Zend_Loader_Autoloader</code></entry>
  482. <entry><itemizedlist>
  483. <listitem><para>
  484. <varname>$flag</varname>, <emphasis>optional</emphasis>.
  485. </para></listitem>
  486. </itemizedlist></entry>
  487. <entry><para>
  488. Set or retrieve the value of the flag used to
  489. indicate whether the default autoloader
  490. implementation should suppress "file not found"
  491. warnings. If no arguments or a <constant>NULL</constant> value is
  492. passed, returns a boolean indicating the status of the flag;
  493. if a boolean is passed, the flag is set to that
  494. value and the autoloader instance is returned (to
  495. allow method chaining).
  496. </para></entry>
  497. </row>
  498. <row>
  499. <entry><methodname>setFallbackAutoloader($flag)</methodname></entry>
  500. <entry><classname>Zend_Loader_Autoloader</classname></entry>
  501. <entry><itemizedlist>
  502. <listitem><para>
  503. <varname>$flag</varname>, <emphasis>required</emphasis>.
  504. </para></listitem>
  505. </itemizedlist></entry>
  506. <entry><para>
  507. Set the value of the flag used to indicate whether
  508. or not the default autoloader should be used as a
  509. fallback or catch-all autoloader for all namespaces.
  510. </para></entry>
  511. </row>
  512. <row>
  513. <entry><methodname>isFallbackAutoloader()</methodname></entry>
  514. <entry><type>Boolean</type></entry>
  515. <entry>N/A</entry>
  516. <entry><para>
  517. Retrieve the value of the flag used to indicate whether
  518. or not the default autoloader should be used as a
  519. fallback or catch-all autoloader for all namespaces.
  520. By default, this is <constant>FALSE</constant>.
  521. </para></entry>
  522. </row>
  523. <row>
  524. <entry><methodname>getClassAutoloaders($class)</methodname></entry>
  525. <entry><type>Array</type></entry>
  526. <entry><itemizedlist>
  527. <listitem><para>
  528. <varname>$class</varname>, <emphasis>required</emphasis>.
  529. </para></listitem>
  530. </itemizedlist></entry>
  531. <entry><para>
  532. Get the list of namespaced autoloaders that could
  533. potentially match the provided class. If none match,
  534. all global (non-namespaced) autoloaders are
  535. returned.
  536. </para></entry>
  537. </row>
  538. <row>
  539. <entry><methodname>unshiftAutoloader($callback, $namespace = '')</methodname></entry>
  540. <entry><classname>Zend_Loader_Autoloader</classname></entry>
  541. <entry><itemizedlist>
  542. <listitem><para>
  543. <varname>$callback</varname>, <emphasis>required</emphasis>.
  544. A valid <acronym>PHP</acronym> callback
  545. </para></listitem>
  546. <listitem><para>
  547. <varname>$namespace</varname>, <emphasis>optional</emphasis>.
  548. A string representing a class prefix namespace.
  549. </para></listitem>
  550. </itemizedlist></entry>
  551. <entry><para>
  552. Add a concrete autoloader implementation to the
  553. beginning of the internal autoloader stack. If a
  554. namespace is provided, that namespace will be used
  555. to match optimistically; otherwise, the autoloader
  556. will be considered a global autoloader.
  557. </para></entry>
  558. </row>
  559. <row>
  560. <entry><methodname>pushAutoloader($callback, $namespace = '')</methodname></entry>
  561. <entry><classname>Zend_Loader_Autoloader</classname></entry>
  562. <entry><itemizedlist>
  563. <listitem><para>
  564. <varname>$callback</varname>, <emphasis>required</emphasis>.
  565. A valid <acronym>PHP</acronym> callback
  566. </para></listitem>
  567. <listitem><para>
  568. <varname>$namespace</varname>, <emphasis>optional</emphasis>.
  569. A string representing a class prefix namespace.
  570. </para></listitem>
  571. </itemizedlist></entry>
  572. <entry><para>
  573. Add a concrete autoloader implementation to the
  574. end of the internal autoloader stack. If a
  575. namespace is provided, that namespace will be used
  576. to match optimistically; otherwise, the autoloader
  577. will be considered a global autoloader.
  578. </para></entry>
  579. </row>
  580. <row>
  581. <entry><methodname>removeAutoloader($callback, $namespace = '')</methodname></entry>
  582. <entry><classname>Zend_Loader_Autoloader</classname></entry>
  583. <entry><itemizedlist>
  584. <listitem><para>
  585. <varname>$callback</varname>, <emphasis>required</emphasis>.
  586. A valid <acronym>PHP</acronym> callback
  587. </para></listitem>
  588. <listitem><para>
  589. <varname>$namespace</varname>, <emphasis>optional</emphasis>.
  590. A string representing a class prefix namespace,
  591. or an array of namespace strings.
  592. </para></listitem>
  593. </itemizedlist></entry>
  594. <entry><para>
  595. Remove a concrete autoloader implementation from
  596. the internal autoloader stack. If a namespace or
  597. namespaces are provided, the callback will be
  598. removed from that namespace or namespaces only.
  599. </para></entry>
  600. </row>
  601. </tbody>
  602. </tgroup>
  603. </table>
  604. </sect2>
  605. </sect1>