[robg adds: I've put the text of the script online for download -- bbedit_php.sit. I don't have BBEdit to this with, so if you try it, please post your comments.]
|
|
|
I'm not too familiar with AppleScript, but I managed to add PHP syntax checking functionality to BBEdit using the following script. If you run the script and there's an error in the active document, it will show you the error and highlight the line with the error. It uses the php binary in /usr -> local -> bin -> php) with parameter -l to do the actual checking.
[robg adds: I've put the text of the script online for download -- bbedit_php.sit. I don't have BBEdit to this with, so if you try it, please post your comments.]
•
[8,830 views]
Hint Options
PHP syntax checker to BBEdit--not working for me
This doesn't seem to do anything. I did copy the script as supplied into BBEdit and cleared tabs and resaved as a script to even get it to stay a script when reopened.
PHP syntax checker to BBEdit--not working for me more info
But then I don't have a folder /usr -> local -> bin -> php.
PHP CLI app
This script (I haven't tried it yet) uses the comman line PHP binary application which, when installed, is typically stored in your /usr/local/bin directory. Your web server is using (I assume) the PHP module for Apache. You won't automatically have the binary just because you have the module. The binary will need to be enable when PHP is made from source.
I have Apples Apache 1.x with Marc Liyanage's PHP module, which doesn't come with the binary version. I recently installed Apache 2 and PHP 4 from Server Logistics. In the download section for their precompiled PHP 4 module is an optional link to download the PHP binary which, as they claim, only works with their PHP module package. I installed it, too, and it works as advertised from the Terminal.
Add a PHP syntax checker to BBEdit
It isn't working for me, I get the following:
Add a PHP syntax checker to BBEdit
For this to work, you must have the command line executable of PHP installed, which is something you have to do intentionally. The MacOS install (and the standard install if you are building from source) is to install an Apache module.
Simple version
Hey all,
Here's my "bare bones" version of the script, if you'll excuse the pun. Tested and works, assuming you have PHP installed, --cli-enable displayed in your phpinfo(); and your php binary is pointed to by the script property phpref. There's a way to create a BBEdit style search results window with this data; maybe when I get some time. Cheers,Isao bbphplint
Simple version
Isao, thanks for this, it works whereas the original did not for me.
PHP Command Line - Precompiled
PHP Command Line - Precompiled
I just installed the PHP from Mark Liynage site earlier this week and I have the CLI PHP installed... /usr/local/bin/php
Works Great!
I used the link from the comments to download and install the pre-compiled php binary. The applescript pops up an error window telling you the line number when it finds mismatched parenthesis and brackets, as well as missing semi-colons. So far I haven't found other types of errors, but I'm sure to generate one soon and I'll report back! One of the other respondents mentioned that it's possible to have the results come back in a BBEdit style search results window, that would be absolutely amazing... imagine the time saved in debugging. I wish BareBones would jump on it, |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.20 seconds |
|