使用 Zend_Loader 选择不同版本的 Zend Framework 进行加载及其问题

发布于 2024-09-30 04:17:33 字数 371 浏览 0 评论 0原文

好的,所以,我希望能够使用 Zend_Loader 选择不同版本的 Zend Framework(和其他框架)。嗯,代码一点也不棘手,但问题是,框架本身中有太多 require_once 行,实际上会使自动加载器毫无用处。

Zend 目录必须位于 include_path 中,这使得将其保留在那里有点困难,而且所有具有非绝对路径的 require_once 行都会对应用程序的性能产生相当大的影响,特别是我的应用程序使用很多 Zend 类来处理每个请求。

我可以手动或自动删除所有 require_once 行,但我只需要在每个新的 1.xx 版本中重新执行一遍。

有什么想法吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

空城仅有旧梦在 2024-10-07 04:17:33

剥离 require_once 并不难,只需运行一行代码(保存为 脚本)。

请参阅 Nabble 上的这个线程 用于切换 Zend Framework 版本。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文