SplAutoloader.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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-2015 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. */
  20. if (interface_exists('Zend_Loader_SplAutoloader')) return;
  21. /**
  22. * Defines an interface for classes that may register with the spl_autoload
  23. * registry
  24. *
  25. * @package Zend_Loader
  26. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  27. * @license http://framework.zend.com/license/new-bsd New BSD License
  28. */
  29. interface Zend_Loader_SplAutoloader
  30. {
  31. /**
  32. * Constructor
  33. *
  34. * Allow configuration of the autoloader via the constructor.
  35. *
  36. * @param null|array|Traversable $options
  37. * @return void
  38. */
  39. public function __construct($options = null);
  40. /**
  41. * Configure the autoloader
  42. *
  43. * In most cases, $options should be either an associative array or
  44. * Traversable object.
  45. *
  46. * @param array|Traversable $options
  47. * @return SplAutoloader
  48. */
  49. public function setOptions($options);
  50. /**
  51. * Autoload a class
  52. *
  53. * @param $class
  54. * @return mixed
  55. * False [if unable to load $class]
  56. * get_class($class) [if $class is successfully loaded]
  57. */
  58. public function autoload($class);
  59. /**
  60. * Register the autoloader with spl_autoload registry
  61. *
  62. * Typically, the body of this will simply be:
  63. * <code>
  64. * spl_autoload_register(array($this, 'autoload'));
  65. * </code>
  66. *
  67. * @return void
  68. */
  69. public function register();
  70. }