cakephp 3.0升级工具-麻烦理解文档-安装工具在哪里-文件夹要升级-在哪里? [英] cakephp 3.0 upgrade tool - Trouble understanding docs - Install tool where - folder to upgrade - where?

查看:118
本文介绍了cakephp 3.0升级工具-麻烦理解文档-安装工具在哪里-文件夹要升级-在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试转换100个模型+数百个控制器&从cakephp 2.6.7到cakephp 3.0.7的视图。



我已尝试使用升级外壳工具进行以下操作:




  • 下载zip文件

  • 放入项目主文件夹(即Cake 2.6.7应用所在的文件夹)

  • php composer.phar安装

  • composer全部升级。这将安装所有cakePHP 3.0

  • 然后文档让我有很多疑问...



    升级工具提供了一个独立的应用程序,可用于升级其他应用程序或cakephp插件。每个子命令都接受一个指向您要升级的应用程序的路径。



    cd / path / to / upgrade



    bin / cake升级所有/ home / mark / Sites / my-app



    bin / cake升级框架/ home / mark / Sites / my-app



    bin / cake升级位置[路径]



    bin / cake升级名称空间[路径]



    bin / cake升级app_uses [path]




首先...我已经在E:\my-app中!



第二...运行蛋糕升级位置E:\my-app(第一个任务命令)没有任何修改,也没有文件移动。实际上,如果我运行文档中列出的每个命令并且从不使用 all命令,则\src文件夹几乎为空。它确实包含一个Templates文件夹!



\app文件夹仍然具有所有Controllers,Views,Models。



没有表,实体等。



对于需要以不同方式查看的内容,我可以使用一些提示。任何帮助将不胜感激。

解决方案

首先,升级外壳是一个独立的应用程序,应单独安装,即在单独的文件夹中(例如 E:\cakephp-upgrade\ ),而不是项目文件夹中的 !同样,当使用 all 命令时,不必再次运行单个命令,它将呈现 all



话虽这么说,不可移动文件的问题源于两个问题


  1. 传递给升级外壳的路径必须以目录分隔符结尾,否则外壳将在某些时候使用双分隔符,因为分隔符留在了路径 从根中剥离根时它 https://github.com/cakephp/升级/问题/ 89 )。


  2. 不使用GIT时,需要移动和更改文件,然后文件未写入正确的目标路径, 但转到源路径 https://github.com/cakephp/upgrade/issues/90 )。


将此问题报告为 在GitHub上。



不幸的是,GIT的使用似乎也有问题( https://github.com/ cakephp / upgrade / issues / 88 ),但我现在懒得追查。因此,在解决所有问题之前,您应该可以通过手动运行 all 命令来解决这些问题,这样可以首先移动文件,这似乎很好用。



因此,假设升级应用程序安装在 E:\cakephp-upgrade\ 中,而您的项目位于 E:\my-app ,那么您要做

  E:
cd cakephp-upgrade
bin\cake升级位置E:\my-app\
bin\cake升级名称空间E:\my-app\
bin\ \cake upgrade app_uses E:\my-app\
bin\cake升级rename_classes E:\my-app\
bin\cake升级rename_collections E:\my-app\ \
bin\cake升级方法名称E:\my-app\
bin\cake升级方法_signatures E:\my-app\
bin\cake升级装置E :\my-app\
bin\cake升级测试E:\my-app\
bin\cake升级i18n E:\my-app\
bin\cake升级prefixed_templates E:\my-app\
bin\cake升级框架E:\my-app\

I'm trying to convert 100 models + several hundred controllers & views from cakephp 2.6.7 to cakephp 3.0.7.

I've tried the following with the upgrade shell tool:

  • download the zip file
  • place into project main folder (i.e. same folder that cake 2.6.7 app resides)
  • php composer.phar install
  • composer upgrade all. This installs all of cakePHP 3.0
  • Then the docs leave me with lots of questions...

    The upgrade tool provides a standalone application that can be used to upgrade other applications or cakephp plugins. Each of the subcommands accepts a path that points to the application you want to upgrade.

    cd /path/to/upgrade

    bin/cake upgrade all /home/mark/Sites/my-app

    bin/cake upgrade skeleton /home/mark/Sites/my-app

    bin/cake upgrade locations [path]

    bin/cake upgrade namespaces [path]

    bin/cake upgrade app_uses [path]

First... I'm already in E:\my-app !

Second... After running a "cake upgrade locations E:\my-app" (the first task command) Nothing is modified and no files are moved. In fact if I run each of the commands listed in the documentation and never use the "all" command, the \src folder is almost empty. It does contain a Templates folder!

The \app folder still has all the Controllers, Views, Models.

There are not Tables, Entities, etc.

I could use a little hint as to what I need to see differently. Any assistance would be greatly appreciated.

解决方案

First things first, the upgrade shell is a standalone application, and you should install it separately, that is, in a separate folder (for example E:\cakephp-upgrade\), not in your project folder! Also when using the all command, it should not be necessary to run the individual commands again, it would render the all command pretty useless if you'd have to do that.

That being said, the problem with the non-moved files stems from two issues

  1. The path passed to the upgrade shell must end with a directory separator, otherwise the shell will use double separators at some point, because a separator is left in the path when the root is being stripped from it (https://github.com/cakephp/upgrade/issues/89).

  2. When not using GIT, and files need to be moved as well as changed, then the files are not being written to the proper target path, but to the source path (https://github.com/cakephp/upgrade/issues/90).

Please report this as an issue over at GitHub.

Unfortuantely the GIT usage seems to be buggy too (https://github.com/cakephp/upgrade/issues/88), but I'm too lazy to trace this down right now. So until this is all fixed, you should be able workaround these issues by running all the commands manually, that way the files are being moved first, which seems to work fine.

So, assuming that the upgrade app is installed in E:\cakephp-upgrade\, and your project is in E:\my-app, then you'd do

E:
cd cakephp-upgrade
bin\cake upgrade locations E:\my-app\
bin\cake upgrade namespaces E:\my-app\
bin\cake upgrade app_uses E:\my-app\
bin\cake upgrade rename_classes E:\my-app\
bin\cake upgrade rename_collections E:\my-app\
bin\cake upgrade method_names E:\my-app\
bin\cake upgrade method_signatures E:\my-app\
bin\cake upgrade fixtures E:\my-app\
bin\cake upgrade tests E:\my-app\
bin\cake upgrade i18n E:\my-app\
bin\cake upgrade prefixed_templates E:\my-app\
bin\cake upgrade skeleton E:\my-app\

这篇关于cakephp 3.0升级工具-麻烦理解文档-安装工具在哪里-文件夹要升级-在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆