Closed (fixed)
Project:
Zend Framework
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Oct 2009 at 16:25 UTC
Updated:
28 May 2011 at 18:11 UTC
This small patch implements PHP autoloading so you just need to use Zend_* classes into your modules, no need to initialize nor anything.
It will work for any class whose name starts with 'Zend_*' and needs PHP > 5.1.2. About PHP autoload, see http://www.php.net/manual/en/function.spl-autoload-register.php
It also gets rid of the global variable, which I don't see why it's needed, and makes it a static one.
| Comment | File | Size | Author |
|---|---|---|---|
| zend_autoload.patch | 1.25 KB | jose reyero |
Comments
Comment #1
robloachThanks a lot! I love it.
We probably don't want that dsm in there ;-) . Applies cleanly to HEAD too!
Comment #2
robloachActually, we might want to look into Autoload Drupal module and possibly add it as a dependency.
Comment #3
jose reyero commentedThe issue with Autoload is that you need to define all classes previously (hook_autoload_info), while in this case we are doing class autoloading using only class name.
This patch is compatible with Autoload, actually I'm using both in the same install.
Comment #4
mfer commentedWhy not just use the Zend_Loader to do the heavy lifting for Zend?
Comment #5
mfer commentedThis is what the 2.x branch and Drupal 7 versions already do.