Laravel 异常直接用 phpstorm 打开定位

2019-07-03 10:05:46 阅读:1 编辑

open_phpstorm.vbs ( 复制到 c:\Windows\system32 目录)

Set objShell = CreateObject ("WScript.Shell")
dim txt,pos,file,line
path = """C:\Program Files\JetBrains\PhpStorm 2018.1.6\bin\phpstorm64.exe"""
Set args = WScript.Arguments
rem WScript.Echo (args.Count)
If args.Count = 1 Then
rem txt="phpstorm://open/?file=E%3 A%5 Cedison%5 Cform%5 Capp%5 CHttp%5 CControllers%5 CHomeController.php&line=10" 
    txt = WScript.Arguments (0)
    pos=InStr (txt,"&")
    line = Mid (txt,pos + 6)
    file = Mid (txt,23, pos -23)
    file = Replace (file,"%3 A",":")
    file = Replace (file,"%5 C","\")
    rem WScript.Echo (file)

    line = "--line" & line & " "
    rem strAttr2 = "E:\edison\form\App\Http\Controllers\HomeController.php"

    cmd= path & line & file 
    objShell.Run cmd
rem WScript.Echo (cmd)
End If

phpstorm.reg(注册表,双击导入)

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\phpstorm]
@="phpstorm Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\phpstorm\shell]
@=""

[HKEY_CLASSES_ROOT\phpstorm\shell\open]
@=""

[HKEY_CLASSES_ROOT\phpstorm\shell\open\command]
@="\"C:\\Windows\\System32\\wscript.exe\"\"C:\\Windows\\System32\\open_phpstorm.vbs\"\"%1\""

config/app.php ( 添加配置)

'editor'=>'phpstorm',