<small id='WmmvB'></small><noframes id='WmmvB'>

        <bdo id='WmmvB'></bdo><ul id='WmmvB'></ul>
    1. <i id='WmmvB'><tr id='WmmvB'><dt id='WmmvB'><q id='WmmvB'><span id='WmmvB'><b id='WmmvB'><form id='WmmvB'><ins id='WmmvB'></ins><ul id='WmmvB'></ul><sub id='WmmvB'></sub></form><legend id='WmmvB'></legend><bdo id='WmmvB'><pre id='WmmvB'><center id='WmmvB'></center></pre></bdo></b><th id='WmmvB'></th></span></q></dt></tr></i><div id='WmmvB'><tfoot id='WmmvB'></tfoot><dl id='WmmvB'><fieldset id='WmmvB'></fieldset></dl></div>
    2. <tfoot id='WmmvB'></tfoot>

      1. <legend id='WmmvB'><style id='WmmvB'><dir id='WmmvB'><q id='WmmvB'></q></dir></style></legend>

        从 Zend Framework 1 到 2 的逐步迁移

        时间:2023-05-31

          <i id='m9VjP'><tr id='m9VjP'><dt id='m9VjP'><q id='m9VjP'><span id='m9VjP'><b id='m9VjP'><form id='m9VjP'><ins id='m9VjP'></ins><ul id='m9VjP'></ul><sub id='m9VjP'></sub></form><legend id='m9VjP'></legend><bdo id='m9VjP'><pre id='m9VjP'><center id='m9VjP'></center></pre></bdo></b><th id='m9VjP'></th></span></q></dt></tr></i><div id='m9VjP'><tfoot id='m9VjP'></tfoot><dl id='m9VjP'><fieldset id='m9VjP'></fieldset></dl></div>
            • <bdo id='m9VjP'></bdo><ul id='m9VjP'></ul>
              <tfoot id='m9VjP'></tfoot>
                <tbody id='m9VjP'></tbody>

                  <legend id='m9VjP'><style id='m9VjP'><dir id='m9VjP'><q id='m9VjP'></q></dir></style></legend>

                  <small id='m9VjP'></small><noframes id='m9VjP'>

                  本文介绍了从 Zend Framework 1 到 2 的逐步迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我必须将应用程序从 Zend Framework 1.12.0 迁移到版本 2.似乎有 尚无迁移指南.我已经研究了 ZF2 编码约定,并采用了依赖注入 (ZendDi) 和 PHP 5.3 命名空间.我的目标是将我的 ZF1 应用程序重构为 ZF2 模块.

                  I have to migrate an application from Zend Framework 1.12.0 to version 2. There seem to be no migration guides yet. I have already studied ZF2 coding conventions and I adopted dependency injection (ZendDi) and PHP 5.3 namespaces. My goal is to refactor my ZF1 application into a ZF2 module.

                  问题:是否有可能在每个步骤之后使用至少部分工作的应用程序避免大量重构步骤?如果是,步骤是什么?

                  Question: Is it possible to proceed step-by-step with an at least partly working application after every step and avoid huge refactoring steps? If yes, what are the steps?

                  这是我对这种分步迁移的想法,但我不知道我是否在每一步都得到了一个工作应用程序:

                  Here's my idea of such a step-by-step migration, but I don't know if I end up with a working application after every step:

                  1. 首先设置 ZF2 骨架应用程序
                  2. 设置新模块(MyApp)并重新组织我的 ZF1 应用程序的内容到 MyApp 模块文件夹结构中.然后通过从 ZF2 AbstractActionController 扩展它来设置非常基本的配置和引导和迁移 IndexController.模型 (Zend_Db) 和视图 (Zend_View) 将在稍后迁移.这里的目标是让 IndexController::indexAction 没有太多依赖项.
                  3. 设置更多配置和引导(路由、翻译、区域设置、缓存、Db、Acl、ViewHelpers 等).我想先设置这些组件的 ZF1 版本,然后再逐个迁移.
                  4. 使用 ZendDi 或 使用 ServiceManager.
                  5. 通过使旧的 phing 脚本与新的目录结构一起工作来设置自动部署.
                  6. 将视图(包括助手)和表单迁移到 ZF2.
                  7. 迁移模型(从 Zend_Db 到 ZF2 ZendDb 或到 Doctrine).
                  8. 一一迁移其他 ZF1 组件(翻译、区域设置、缓存、Acl 等).
                  9. 重构康复和长假.
                  1. Start by setting up the ZF2 Skeleton Application
                  2. Set up a new module (MyApp) and reorganize the contents of my ZF1 application into the MyApp module folder structure. Then set up very basic configuration and bootstrapping and migrate the IndexController by extending it from the ZF2 AbstractActionController. The models (Zend_Db) and views (Zend_View) will be migrated later. The goal here is to have a working IndexController::indexAction which doesn't have many dependencies.
                  3. Set up more configuration and bootstrapping (Routing, Translate, Locale, Cache, Db, Acl, ViewHelpers, ...). I'd like to set up the ZF1 versions of these components first and migrate them later one by one.
                  4. Migrate the other controllers and set up dependency injection into the controllers either with ZendDi or by using the ServiceManager.
                  5. Set up automatic deployment by making the old phing scripts work with the new directory structure.
                  6. Migrate the views (including helpers) and forms to ZF2.
                  7. Migrate the models (from Zend_Db either to ZF2 ZendDb or to Doctrine).
                  8. Migrate other ZF1 components one by one (Translate, Locale, Cache, Acl, ...).
                  9. Refactoring rehab and long holiday.

                  但是,只有当某些 ZF2 组件与 ZF1 组件一起工作时,我才会在每一步之后都有一个 workin 应用程序.我不知道它是否是例如可以将 ZF1 视图(和视图助手)与 ZF2 控制器一起使用.

                  However, I will have a workin application after every step only if certain ZF2 components work together with ZF1 components. I have no idea if it's e.g. possible to use ZF1 views (and view helpers) with ZF2 controllers.

                  推荐答案

                  从 Zend Framework 1 迁移

                  本指南旨在提供从 Zend Framework 1 迁移到 Zend Framework 2 的工具和策略.没有适用于每个项目的单一解决方案,也没有任何工具可以使流程自动化.

                  This guide is intended to provide tools and strategies for migrating from Zend Framework 1 to Zend Framework 2. There is no single solution that will work for every project, nor any tools to automate the process.

                  在本指南中,我们将介绍以下内容:

                  In this guide, we will cover the following:

                  1. 用于为代码命名空间的工具.
                  2. 用于在 Zend Framework 1 应用程序中使用 Zend Framework 2 的工具.
                  3. 并行运行 Zend Framework 2 和 Zend Framework 1 的策略.
                  4. 使代码更易于迁移的策略,主要侧重于域逻辑和 MVC 层的清晰分离.
                  5. 迁移 MVC 层的策略.
                  6. 迁移域层的策略.

                  http://framework.zend.com/manual/2.1/en/migration/overview.html

                  这篇关于从 Zend Framework 1 到 2 的逐步迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:我从哪里开始使用 Zend 框架? 下一篇:如何使用 Zend OpenID 实现基于直接身份的 OpenID 身份验证

                  相关文章

                  <small id='cWmpj'></small><noframes id='cWmpj'>

                1. <legend id='cWmpj'><style id='cWmpj'><dir id='cWmpj'><q id='cWmpj'></q></dir></style></legend>
                  <tfoot id='cWmpj'></tfoot>

                      • <bdo id='cWmpj'></bdo><ul id='cWmpj'></ul>
                      <i id='cWmpj'><tr id='cWmpj'><dt id='cWmpj'><q id='cWmpj'><span id='cWmpj'><b id='cWmpj'><form id='cWmpj'><ins id='cWmpj'></ins><ul id='cWmpj'></ul><sub id='cWmpj'></sub></form><legend id='cWmpj'></legend><bdo id='cWmpj'><pre id='cWmpj'><center id='cWmpj'></center></pre></bdo></b><th id='cWmpj'></th></span></q></dt></tr></i><div id='cWmpj'><tfoot id='cWmpj'></tfoot><dl id='cWmpj'><fieldset id='cWmpj'></fieldset></dl></div>