Cakephp 3 升级工具无法访问文件

Cakephp 3 upgrade tools unable to access file

我尝试使用 Cakephp 3 upgrade tool

我安装了作曲家,我做了这个:

cd /path/to/upgrade
bin/cake upgrade all /home/mark/Sites/my-app

然后我在 windows 命令 shell 中得到大量这样的错误。

error: Could not access ''C:\mydir\upgrade\tmp\upgrade\a2d4223f62e3499a84b6ca30be24bfdb4cb6de40''
Update C:\mydir\myapp\lib\Cake\View\Helper\CacheHelper.php
error: Could not access ''C:\mydir\upgrade\tmp\upgradefbe7651712387f351b1eb670b14c18e1161fcb8''
Update C:\mydir\myapp\lib\Cake\View\Helper\HtmlHelper.php
error: Could not access ''C:\mydir\upgrade\tmp\upgrade01f9bed1167ddb29ca4e06706d0d21bd015766''
Update C:\mydir\myapp\lib\Cake\View\Helper\NumberHelper.php
error: Could not access ''C:\mydir\upgrade\tmp\upgrade\e71af0cbc7df7ff76e801c5fb06ec07ee7f45233''
Update C:\mydir\myapp\lib\Cake\View\Helper\PaginatorHelper.php
error: Could not access ''C:\mydir\upgrade\tmp\upgradeb04b5a763ca4e798d1e176111e49008b7486724''
Update C:\mydir\myapp\lib\Cake\View\Helper\TextHelper.php
error: Could not access ''C:\mydir\upgrade\tmp\upgrade\f8ead667c131610c1f70f38d10c7122b34d9a7fc''
Update C:\mydir\myapp\lib\Cake\View\Helper\TimeHelper.php
error: Could not access ''C:\mydir\upgrade\tmp\upgradea2c2e7f3f7e9faf744d10e6e1f3ff24bead7f08''
Update C:\mydir\myapp\lib\Cake\View\HelperCollection.php

我 运行 作为管理员命令 shell。会有什么问题?当我在运行过程中检查文件夹时,我可以看到文件夹中存在临时文件。

我遇到了同样的问题。这是问题的描述:

  • 这是一个 Git 错误
  • Git 失败的命令由第 176 行的 /upgradeTool/src/Shell/Task/StageTask.php 通过 exec() php 函数调用(对您来说似乎不同)
  • 命令 运行 git 看起来像这样:git diff --no-index 'T:\Logiciels\CakePHP_3_upgradeTool\tmp\upgrade\c5d0aaadb3484d4bfe56bdfc4553b444f6789e66' 'T:\Logiciels\CakePHP_3_upgradeTool\tmp\upgradea6662f82cd03d46b515c28f7d77ef8a64c08cfd'

编辑 (2015-07-12)

正如 ndm 指出的那样,"the source of the problem is the single quote usage in the arguments for the git command, the Windows CLI will pass them as if they belong to the file path"

我将这一行(第 176 行的 /upgradeTool/src/Shell/Task/StageTask.php)从 :

更改为
exec("git diff --no-index "$oPath" "$uPath"', $output);

至:

exec('git diff --no-index "'.$oPath.'" "'.$uPath.'"', $output);

现在这个过程似乎完成了。非常感谢!

试用后我找到了解决方案。正如 DarXnake 指出的那样,问题是 git.

当您安装 git 时,它会询问您是否要从命令行使用 git。默认选项是 Use Git Bash only。我选择了那个选项。

现在我更新了 git,当安装程序询问安装类型时,我选择了 Run Git from the Windows Command Prompt。然后我重试了 cakephp 升级,我没有收到任何访问错误。