2017-09-27 58 views
0

我通過編寫器正確安裝了所有東西,並將codesniff腳本路徑添加到了環境中。當我在命令行運行這個:在Windows 10下使用Joomla標準崇拜phpcs codesniff

phpcs --report=checkstyle --standard=Joomla -n C:\xampp\htdocs\myfile.php 

我得到一個正確的XML codesniff輸出。

問題是我不能讓它與崇高3.運行我安裝了phpcs包,並將此用戶設置:

{ 
    "show_debug": true, 
    "phpcs_additional_args": { 
     "--standard": "Joomla", 
     "-n": "" 
    } 
} 

當我嘗試嗅探文件我在控制檯中看到這一點:

[Phpcs] phpcs --report=checkstyle --standard=Joomla -n C:\xampp\htdocs\myfile.php 
[Phpcs] phpcs --report=checkstyle --standard=Joomla -n C:\xampp\htdocs\myfile.php 
[Phpcs] cwd: C:\xampp\htdocs\myfile.php 
Traceback (most recent call last): 
    File "./python3.3/subprocess.py", line 1104, in _execute_child 
FileNotFoundError: [WinError 2] System can't find the file 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 818, in run_ 
    return self.run(edit) 
    File "phpcs in C:\Users\xxx\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 661, in run 
    File "phpcs in C:\Users\xxx\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 479, in run 
    File "phpcs in C:\Users\xxx\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 149, in get_errors 
    File "phpcs in C:\Users\xxx\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 231, in execute 
    File "phpcs in C:\Users\xxx\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 234, in parse_report 
    File "phpcs in C:\Users\xxx\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 176, in shell_out 
    File "./python3.3/subprocess.py", line 819, in __init__ 
    File "./python3.3/subprocess.py", line 1110, in _execute_child 
FileNotFoundError: [WinError 2] System can't find the file 
+0

哇,joomla有標準嗎?無論如何,聽起來像一個破碎的插件。 – delboy1978uk

回答

0

的解決辦法是:

  1. 雖然我有phpcs PATH環境變量設置,我可以調用PHP CS從到處命令我不得不設置phpcs_executable_path到一個完整路徑等 "phpcs_executable_path": "c:\\Users\\xxx\\AppData\\Roaming\\Composer\\vendor\\squizlabs\\php_codesniffer\\scripts\\phpcs.bat"

  • 我不得不添加的--no-patch ARG因爲所述無存在於phpcbf下香草窗戶這樣
  • "phpcbf_additional_args": { "--standard": "Joomla", "--no-patch": "", "-n": "" },


    命令
    1. 我必須編輯phpcs.bat文件並用PHP可執行文件的完整路徑替換@[email protected]。不知怎的,作曲家在Prozess那些應該被替換,但它並沒有發生: if "%PHPBIN%" == "" set PHPBIN=c:\xampp\php\php.exe

    所以做了很多的廢話。在所有安裝過程中,我的窗戶接縫不能很好地支撐。

    相關問題