|
1 <?php |
|
2 /** |
|
3 * Zend Framework |
|
4 * |
|
5 * LICENSE |
|
6 * |
|
7 * This source file is subject to the new BSD license that is bundled |
|
8 * with this package in the file LICENSE.txt. |
|
9 * It is also available through the world-wide-web at this URL: |
|
10 * http://framework.zend.com/license/new-bsd |
|
11 * If you did not receive a copy of the license and are unable to |
|
12 * obtain it through the world-wide-web, please send an email |
|
13 * to license@zend.com so we can send you a copy immediately. |
|
14 * |
|
15 * @category Zend |
|
16 * @package Zend_Loader |
|
17 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
|
18 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
19 */ |
|
20 |
|
21 if (interface_exists('Zend_Loader_SplAutoloader')) return; |
|
22 |
|
23 /** |
|
24 * Defines an interface for classes that may register with the spl_autoload |
|
25 * registry |
|
26 * |
|
27 * @package Zend_Loader |
|
28 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
|
29 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
30 */ |
|
31 interface Zend_Loader_SplAutoloader |
|
32 { |
|
33 /** |
|
34 * Constructor |
|
35 * |
|
36 * Allow configuration of the autoloader via the constructor. |
|
37 * |
|
38 * @param null|array|Traversable $options |
|
39 * @return void |
|
40 */ |
|
41 public function __construct($options = null); |
|
42 |
|
43 /** |
|
44 * Configure the autoloader |
|
45 * |
|
46 * In most cases, $options should be either an associative array or |
|
47 * Traversable object. |
|
48 * |
|
49 * @param array|Traversable $options |
|
50 * @return SplAutoloader |
|
51 */ |
|
52 public function setOptions($options); |
|
53 |
|
54 /** |
|
55 * Autoload a class |
|
56 * |
|
57 * @param $class |
|
58 * @return mixed |
|
59 * False [if unable to load $class] |
|
60 * get_class($class) [if $class is successfully loaded] |
|
61 */ |
|
62 public function autoload($class); |
|
63 |
|
64 /** |
|
65 * Register the autoloader with spl_autoload registry |
|
66 * |
|
67 * Typically, the body of this will simply be: |
|
68 * <code> |
|
69 * spl_autoload_register(array($this, 'autoload')); |
|
70 * </code> |
|
71 * |
|
72 * @return void |
|
73 */ |
|
74 public function register(); |
|
75 } |