Check for Zend Framework on Install

jsloan - December 31, 2007 - 23:25
Project:Zend Framework
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Nice module to support the ZF. I am developing a Lucene Search module and this will help out.

I thought it would be nice to search the include_path to see if ZF was already available. This patch is a quick stab at adding this functionality.

Also; if the user would like to override the system path with an alternative location then entering the alternative path and saving the setting would do this.

It may also be good to check for PHP5 and prevent installation if not present.

Thanks again for a good contribution!

AttachmentSize
look_for_zend.patch1.34 KB

#1

mustafau - January 1, 2008 - 01:42
Status:needs review» needs work

Only applying this patch will not allow the user to override the system path with an alternative location. Because currently zend_include and zend_require functions do not support overriding.

Perhaps we should add another field to the settings form which will ask for an alternative location. Then we should modify zend_include and zend_require to override the system path with alternative location.

#2

Rob Loach - January 2, 2008 - 06:44

I'm not confident with how zend_include and zend_require operate. It should not have to include and then try another location on failure. It should just include once and work. Adding another "alternate" location for the Zend Framework is a bad idea and will just confuse the end user. Giving the Zend Framework install location is the solution for adding an alternative path (it usually should already be in the include path).

Using a search is a good idea, and I think we should put it into the module installation process.

#3

jsloan - January 2, 2008 - 16:06

Oh I agree that this is not for "try another location on failure."
What I intended was
1)see if there is already a path to the ZF
2)make that the default for the Zend module
3)if the user enters in another location then it will be used. This way a new version could be tested while not uninstalling the current version.

#4

Rob Loach - January 5, 2008 - 06:12
Status:needs work» won't fix

It now assumes that the Zend Framework is already in the include path. I think having it search for the Zend Framework at installation is a bad idea and is easily fixed by just having the user state where it is in the configuration page. Now that that fix is in, management is much easier as you use the API as such:

if (zend_initialize('Zend_Gdata')) {
   $gdata = new Zend_Gdata();
   $gdata->doStuff();
}
else {
  echo 'Zend GData not available!';
}

This will fix a lot of things that were wrong with the previous design.

#5

Rob Loach - January 10, 2008 - 20:15
Title:Test for existing install of the Zend Framework.» Check for Zend Framework on Install
Status:won't fix» active

What we could do is look for the Zend Framework during the installation of the module. So that if the Zend Framework exists in sites/all/modules/zend/library during installation, it sets that to the default installation path.

 
 

Drupal is a registered trademark of Dries Buytaert.