Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 0.8.0
-
Fix Version/s: 0.9.0
-
Component/s: Zend_Loader
-
Labels:None
Description
The recommended directory structure and the recommended use of svn:externals for maintaining user copies of the framework are incompatible. That is, the following structure:
/application /models /views /controllers /document_root /images /styles .htaccess index.php /library /Zend Zend.php /PEAR /SuperLib
cannot be maintained by svn:externals because Zend.php is sibling to the Zend/ directory. The svn:externals property only works upon directories, not files.
An alternative approach:
/application
/models
/views
/controllers
/document_root
/images
/styles
.htaccess
index.php
/library
/ZendFramework
/Zend
Zend.php
/PEAR
/SuperLib
suffers from the problem of requiring each of the children directories of /library to be in the include path, resulting in suboptimal performance when working with multiple libraries.
Thanks to
Andries Seutens for the report!
One solution I have heard suggested is to move Zend.php under the Zend directory. This would be a single exception to our policy that class hierarchy should match directory hierarchy, but it would solve this issue. For example:
/application /models /views /controllers /document_root /images /styles .htaccess index.php /library /Zend Zend.php Db.php, etc. /PEAR /SuperLibThen users could use svn externals to grab the "library/Zend/" directory and they would get everything they need.
The breakage to backward compatibility impact would be that any usage of this:
require_once "Zend.php";Would necessarily be rewritten as follows:
require_once "Zend/Zend.php";But all code invoking the class itself, including static methods and constants, would be unchanged.
Also, the change above could be worked around by adding "library/Zend" to the application's include_path.
/application /models /views /controllers /document_root /images /styles .htaccess index.php /library /Zend Zend.php Db.php, etc. /PEAR /SuperLibrequire_once "Zend.php";require_once "Zend/Zend.php";