Home Download Buy Blog Forum Support

PHP Build System (Lint Check)

PHP Build System (Lint Check)

Postby Dygear on Fri Mar 08, 2013 5:13 pm

I would like to make a PHP Build System for Sublime Text 2. I have most of the things I need already, as php has a built in lint check with the '-l' switch, however it's not quite working for me.

When ever I use Ctrl + B, I get the following output.
Code: Select all
[Errno 2] No such file or directory
[cmd:  [u'php -l /home/dygear/phpLiteAdmin/phpliteadmin.php']]
[dir:  /home/dygear/phpLiteAdmin]
[path: /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games]
[Finished]


That is from the following php.sublime-build file
Code: Select all
{
   "cmd": ["php -l $file"]
}


I tried using $FileName, but that just results in an empty parameter.

---

I'd also like to know of a good lineNumberRegex for parsing php error messages.

Code: Select all
dygear@Dygear-Ubuntu:~/phpLiteAdmin$ php -l phpliteadmin.php

Parse error: syntax error, unexpected 'include_once' (T_INCLUDE_ONCE) in phpliteadmin.php on line 89
Errors parsing phpliteadmin.php


Any suggestions would be helpful.
Dygear
 
Posts: 6
Joined: Fri Feb 15, 2013 11:05 pm

Re: PHP Build System (Lint Check)

Postby lord-lele on Wed Mar 20, 2013 11:34 am

I've successfully write a build command like this:

Code: Select all
{
    "cmd": ["/usr/bin/php", "-l", "${file}"]
}


And I simply read the results in console...
lord-lele
 
Posts: 2
Joined: Wed Mar 20, 2013 11:33 am


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 3 guests