Код: Выделить всё
The editor could not be opened due to an unexpected error: Unable to resolve resource phar://c:/PHP_Tools/phpcbf/src/Config.php
затем зависает, если нажимаю CTRL C, то тоже получаю
Код: Выделить всё
The editor could not be opened due to an unexpected error: Unable to resolve resource phar://c:/Program%20Files/PHP_Tools/phpcbf/src/Config.php
Вчера я нашел это . phar-файлы были связаны с VSCODE, поэтому я, хотя, возможно, это было так, я удалил из regedit HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts и перезапустил, все заработало, но сегодня снова произошел сбой, и реестр все еще отсутствует.
Это происходит с phpcbf и phpcs, но не с phpmd и phpstan
Код: Выделить всё
C:\PHP_Tools
🕙 08:38:52 λ dir
Directory: C:\PHP_Tools
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 16/04/2024 13:40 1460735 phpcbf
-a--- 22/11/2024 8:28 1059 phpcbf.bat
-a--- 16/04/2024 13:39 1460731 phpcs
-a--- 22/11/2024 8:25 59 phpcs.bat
-a--- 12/03/2024 10:57 3168622 phpmd
-a--- 22/11/2024 8:25 59 phpmd.bat
-a--- 12/03/2024 11:19 22528065 phpstan
-a--- 22/11/2024 8:25 61 phpstan.bat
Код: Выделить всё
C:\PHP_Tools
🕙 08:39:17 λ cat .\phpcbf.bat
@echo off
REM Set a temporary file to store the output
set outputFile=%TEMP%\phpcbf_output.txt
REM Run phpcbf command and redirect output to the temporary file
C:\xampp7\php\php.exe "C:\PHP_Tools\phpcbf" %* > "%outputFile%"
REM Store the exit code of phpcbf
set exitCode=%ERRORLEVEL%
REM Print the exit code for debugging
echo Exit Code: %exitCode%
REM Check if the output contains the specific phrase
findstr /C:"PHPCBF FAILED TO FIX" "%outputFile%" > nul
REM Check the exit code of phpcbf and the presence of the phrase
IF %exitCode% EQU 0 (
REM phpcbf encountered no fixable errors
exit /b 0
) ELSE IF %exitCode% EQU 1 (
REM phpcbf found error and fixed them or found unfixable errors
IF ERRORLEVEL 1 (
echo "The phrase was not found in the output"
exit /b 0
) ELSE (
echo "The phrase was found in the output"
exit /b 1
)
) ELSE (
REM error code 2, fatal error, worng syntax?
type "%outputFile%"
exit /b 1
)
Код: Выделить всё
C:\PHP_Tools
🕙 08:39:21 λ cat .\phpcs.bat
@echo off
C:\xampp7\php\php.exe "C:\PHP_Tools\phpcs" %*
Подробнее здесь: https://stackoverflow.com/questions/792 ... -in-vscode
Мобильная версия