0

I have a standard ZF structure

library -wil -Auth -Adapter.php

In this folder /libary/Wil/Auth/Adapter I have this class

based on http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/

class Wil_Auth_Adapter implements Zend_Auth_Adapter_Interface {

}

and in the application.ini I declare my autoloaderNamespaces[]="Wil"

I have nothing in the bootstrap to register it as a Helper Broker or anything.

My question is why does it work when i call it from a controller like so $adapter = new Wil_Auth_Adapter()

It is probably clear that I don't understand the autoloader & resources & bootstrapping in ZF.

Where can I get a good explanation of the process?

Siguza
  • 21,155
  • 6
  • 52
  • 89
Wil
  • 1,778
  • 1
  • 16
  • 15

1 Answers1

0

The autoloader automatically includes classes when they are first used. Resources are 'things' that the application uses such as a database connection, cache, autoloader. The bootstrap process sets up these resources. So these are three separate things but they are linked.

Your auth adapter is just a class, so it doesn't need any special setup via. brokers. The autoloader knows that a class called Wil_Auth_Adapter will live at Wil/Auto/Adapter.php, and it checks through the folders on the include_path (which include the library folder by default) for that class.

Tim Fountain
  • 33,093
  • 5
  • 41
  • 69
  • Thanks I am getting it now - also thanks to this http://stackoverflow.com/questions/10931631/zf-include-path – Wil Jun 12 '12 at 13:09