Closed (fixed)
Project:
Zend Framework
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Feature request
Assigned:
Reporter:
Created:
19 Dec 2007 at 14:48 UTC
Updated:
23 Jan 2008 at 16:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
robloachFixed by 92034 and 92032 for both Drupal 5 and Drupal 6.
Comment #2
mustafau commentedA
hook_init()implementation in Zend module for 6.x can be used to callzend_set_include_path().zend_set_include_path()function should try to include a Framework class (example:include_once 'Zend/Version.php';) before altering the path. Then if that fails Zend Framework's library path should be located and added to the include path.hook_init()implementations in 5.x are called on every page request including cached pages. This means 5.x version of Zend module should not rely onhook_init(). Other modules should callzend_set_include_path()before including Zend Framework classes.Comment #3
robloachHere's the todo list......
Drupal 5:
Put
zend_set_include_pathinhook_menu(!$may_cache).Drupal 6:
Put
zend_set_include_pathinhook_init.zend_include():
Remove the
zend_set_include_pathstuff,zend_set_include_path():
Add in a check to
zend_ready(FALSE)before adding the include path.Comment #4
robloachhttp://drupal.org/cvs?commit=92063
http://drupal.org/cvs?commit=92061
In Drupal 5, you don't have to call zend_set_include_path before using it because it's called in hook_menu(!$may_cache)...
Comment #5
mustafau commentedI do not like the idea of putting Zend into the module folder because if we do so module files are going to be added to the include path. Instead, should we change the default location to a "library" folder under the module folder. We can put an empty folder named "library" to the distribution package of the module.
The function:
Should be like following:
Comment #6
robloachThis is the default directory and can be changed in the settings. In reality, it should just be blank because most people just add it to the PHP include path manually...
Comment #7
robloachI think the default path should be blank as most "newer" servers include the Zend Framework by default (already in the include path). Any thoughts on this?
Comment #8
robloachComment #9
mustafau commentedI agree.
Comment #10
robloachManagement of this is much easier now. The Zend Framework installation directory defaults to already being included. When the user wants to specify a different path, the system then takes care of including that path for you when it needs the Zend Framework. So, when you need a Zend Framework class, you just do something along the lines of:
Very easy! I've published the REST Server which uses this.
.... This has to be ported to the Drupal 6 branch.
Comment #11
robloachhttp://drupal.org/cvs?commit=94642
Comment #12
mustafau commentedThis breaks my module: http://drupal.org/cvs?commit=94223
zend_require() should not call zend_restore_include_path().
Comment #13
robloachWhoops, thanks. It's strange because that was in the DRUPAL-6--1 branch, but seemed to miss it in the DRUPAL-5 branch. It's in now.
Comment #14
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.