Is there a PHP syntax checker for Notepad++?

前端 未结 6 1078
灰色年华
灰色年华 2021-02-05 01:23

Is there a PHP syntax checker plugin for Notepad++?

Please don\'t answer \"Use another editor instead\"

6条回答
  •  北海茫月
    2021-02-05 02:25

    Adding to @LazyOne's answer: I don't like NetBeans, it's too strict, has a tough time finding includes, and it's slow. I dig N++ for its speed and simplicity. I have php installed on my PC really just to run validation. If you're using N++ (or any other text editor) you can use the following Powershell script to batch check all of the files you've downloaded and are working on. Just fire up Powershell ISE, enter the correct path to check and PHP.exe path for your environment and the results get output to the ISE console.

    cls
    $pathToCheck = "C:\Users\BigDaddy\AppData\Local\Temp\fz3temp-1"
    $phpExePath = "C:\PHP\php.exe"
    
    Get-ChildItem $pathToCheck -Filter "*.php" | foreach {
    $pinfo = New-Object System.Diagnostics.ProcessStartInfo
    $pinfo.FileName = $phpExePath
    $pinfo.Arguments = "-l", $_.FullName
    $pinfo.RedirectStandardError = $true
    $pinfo.RedirectStandardOutput = $true
    $pinfo.UseShellExecute = $false
    $p = New-Object System.Diagnostics.Process
    $p.StartInfo = $pinfo
    $p.Start() | Out-Null
    $p.WaitForExit()
    $output = $p.StandardOutput.ReadToEnd()
    $output += $p.StandardError.ReadToEnd()
    $output
    }
    

    I hope someone else finds this as useful as I have.

    Cheers!

提交回复
热议问题