Zend Framework – Auto Loading and Sessions

The journey is still going on, the porting still happening. So what happens when the you need to setup up an autoloader so that you can remove all the include, include_once, require, require_once calls in the different classes.

It is also necessary in cases where you need to instantiate a class based on a combination of data items. The first thing about the autoloader is that the file name must follow the Zend naming convention, the filename must be the classname.php (even the case matters here).

The second item to note is that the classes must be located in the include path, which must be defined in the bootstrap

The Zend_Session is also a beast which has a lot of configuration each time is used. The approach that we used was a Singleton wrapper class which carries out the configuration, and provides access to the session variables starting with the class at http://calisza.wordpress.com/2008/09/23/simple-php-wrapper-class-for-zend-session/

More on our experiences later

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: