2

Okay, so, I wanna be able to choose different versions of Zend Framework (and other frameworks) using Zend_Loader. Well, the code isn't tricky at all, but the problem is, there are so many require_once lines in the framework itself that would practically make the autoloader useless.

The Zend directory has to be in the include_path which makes it a bit difficult to keep it there and also, all the require_once lines with non-absolute paths will have quite an impact on the application's performance, specially with my app which uses a lot of Zend classes on for processing each request.

I could strip out all the require_once lines manually or automatically, but I just have to do it all over again with each new 1.x.x release.

Any ideas?

takeshin
  • 49,108
  • 32
  • 120
  • 164
Cg Alive
  • 639
  • 1
  • 6
  • 11
  • Why not just change your include path to the correct version. For example I have a constant ZEND_PATH which is added to my include path. Prior to this, I will then define the ZEND_PATH based on the environment determination code. – balupton Oct 30 '10 at 11:21

2 Answers2

1

Stripping require_onces is not that hard, just running one line of code (saved as a script).

See this thread on Nabble for switching Zend Framework versions.

takeshin
  • 49,108
  • 32
  • 120
  • 164
1

See also native ZF support as of 1.10: http://framework.zend.com/manual/1.10/en/zend.loader.autoloader.html#zend.loader.autoloader.zf-version

Pang
  • 9,564
  • 146
  • 81
  • 122