Aprium Software

PHP

PHP Auto Load Includes

I have been recently working with a new contractor and he mentioned after looking at my code that I should think about auto loading the php includes using the __autoload method. At first this sounded great but I soon saw the limitations in this magic method.

The method is called when a class is instantiated but is not defined as a last ditch attempt to find it. Writing a basic function to load in classes that have not been included yet is easy but I wanted a system to include everything.

Syndicate content

Hire

If you need a London based Drupal developer you can hire me. Check the availability page and contact me on info@aprium.net.

 

Powered by Drupal, an open source content management system

Copyright Aprium 2008