3

I am getting a grip on Zend_Autoload but a non-zend class I have is not loading when extended.

The autoloader is initialized like so:

 // Initialise Autoloader
 $autoloader = Zend_Loader_Autoloader::getInstance();
 $autoloader->suppressNotFoundWarnings(true);
 $autoloader->setFallbackAutoloader(true);
 $autoloader->registerNamespace('lib_');
 }

It all works fine with other classes. Is it required to load abstract class files and implemented interfaces manually beforehand?

Charles
  • 50,943
  • 13
  • 104
  • 142
Stephane Gosselin
  • 9,030
  • 5
  • 42
  • 65
  • The auto loader should load all class / interface files on request. Can you describe what's not working? Are there any error messages? – Phil Apr 21 '11 at 03:59
  • Just a silent fail. I am doing a console script that uses a couple of Zend's classes, I tried to implement a viable error handling solution using exception handling and multiple catch block at the end of my script, but a lot of errors don't show up even though error_reporting is set to -1 ( shows all ) and display_error = 1. – Stephane Gosselin Apr 21 '11 at 04:04
  • I posted another question concerning the error handling related to this issue at http://stackoverflow.com/q/5739615/604259. – Stephane Gosselin Apr 21 '11 at 04:43
  • does it load non abstract classes because you specify just the abstract ones? – DarkLeafyGreen Apr 21 '11 at 05:58

1 Answers1

1

Zend_loader_autoloader actually does load abstract classes, idem for any interface a class may implement. Sweet.

A couple of debugging calls straight in the Zend_Loader class quickly indicated my problem: My file was named AbstractTableFetch.php , the class was called FetchTable.

The autoloader obviously will only works if the filename and class name are the same.

Stephane Gosselin
  • 9,030
  • 5
  • 42
  • 65