Archive for the ‘autoload’ tag
PHP Intelligencer, tiny autoload framework
Several months ago I wrote an article that included several interesting examples of __autoload function, some autoloading approaches and a tiny script that is able find interfaces/classes and generate arrays of associations among these classes/interfaces, their locations and extended/included classes/interfaces.
http://wp.drapeko.com/2009/03/28/autoloading-in-php/
I widely use this script and I’ve found it really convenient. I don’t have to think anymore of how to store my classes, what is the structure of the project etc. All this work is done by this script.
But… I have to launch it manually.
I’ve decided to go further and began to create a tiny framework called Intelligencer. This framework will extend functionality of the autoload generator script.
Some Intelligencers features:
- It is very tiny and does not depend on other frameworks and external libraries. It’s very easy to integrate it.
- It has an ability to store and control inheritance associations and relations between classes/interfaces and their locations.
- If something has changed Intelligencer will automatically regenerate (if necessary) lists of associations. It’s really very useful in the development stage.
- Intelligencer has a huge number of config settings. It’s flexible.
- Intelligencer supports environments. You can easily create your custom environments and switch between them.
- You can create several Intelligencers that will be responsible for different parts of your application.
- You can work with Intelligencer both on config level and API level.
If you use it, it will do all work for you. It’s an open source. Location - sourceforge.
The first release will come very soon.
Autoloading in PHP
Have you ever been faced with autoloading in PHP? Are you a newbie? Do you think you understand the nature of autoloading? This article is for you. This article will take approximately 25-35 min.
This article:
- Asks you: what is an autoloading? Do you really understand how __autoload() function works?
- Examines several autoloading approches
- Suggests a script that scans folders for classes and interfaces and generates array of associations between classes and their locations.
Autoloading/Dependency generator: download (4.6 KB) 07 05 2009 →, description ↓
Examples for this article: download (4.0 KB) →, description ↓