-- sk0rp <[email protected]> wrote
(on Tuesday, 02 February 2010, 04:14 AM -0800):
> What I'm trying to do is to set autoloaderZfPath and autoloaderZfVersion in
> application.ini to set the version for my application using ZF. I decided to
> use one copy for ZF library (or libraries - one to each version) for
> applications. The problem is when one application will be using ZF version
> 1.10 and other 1.9 or latter.
>
>
> I added to application.ini:
> autoloaderZfPath = "/path/to/ZendFramework"
> autoloaderZfVersion = "latest"
>
>
> and have file structure like this:
> /path/to/ZendFramework/ZendFramework-1.9.7/library/Zend/...
> /path/to/ZendFramework/ZendFramework-1.10/library/Zend/...
>
>
> I used also standard index.html with:
> // Define path to application directory
> defined('APPLICATION_PATH')
> || define('APPLICATION_PATH', realpath(dirname(__FILE__) .
> '/../application'));
> // Define application environment
> defined('APPLICATION_ENV')
> || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ?
> getenv('APPLICATION_ENV') : 'production'));
> // Ensure library/ is on include_path
> set_include_path(implode(PATH_SEPARATOR, array(
> realpath(APPLICATION_PATH . '/../library'),
> get_include_path(),
> )));
> /** Zend_Application */
> require_once 'Zend/Application.php';
>
> The problem is how to get Zend/Application.php and from where if I still
> don't know which version to use - this information is in application.ini
> which is load later.
Yeah, there's a bit of a chicken-and-the-egg problem here.
What I'd do is ensure that the 1.10 library (or higher) is on your
system include_path. This ensures you can at least load Zend_Application
and/or Zend_Loader_Autoloader. Once those are loaded, you can inform
Zend_Loader_Autoloader where ZF installs are and which version to use
(via configuration or programmatically).
Alternately, create a directory to put in your include_path that has
only:
Zend/
Application.php
Application/
Exception.php
Exception.php
Loader.php
Loader/
Autoloader.php
Autoloader/
Interface.php
Exception.php
(Use the files from 1.10 or above to do this.)
--
Matthew Weier O'Phinney
Project Lead | [email protected]
Zend Framework | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc