Coda PHP Toolkit
Posted 4 months ago.
A Coda plugin aimed at PHP & Web development.
Features
- PHP syntax validation with
jump to error
- Use tidy to clean up/beautify HTML/CSS code (Configurable)
- HTML and CSS Validation
- Use phptidy to clean up/beautify PHP code
- Strip PHP whitespace and comments
- Automatic check for updates
All features use the editor buffer (no need to save first), works with local and remote files.
Preferences can be set. Written in Cocoa/ObjC.
Planned Features
HTML Tidy configuration editable via preferences- More general approach to online validation
- Automatically install updates (if possible)
- Generalized filters (maybe?)
Screenshots
Download
Download Coda PHP & Web Toolkit 1.7 »
Like this?
Support on iusethis.com »…
..or leave a comment, spread the word, visit the ads, donate.
Also like to have an avatar image? Get one at gravatar.com (free) »

Hi
I am afraid the plugin I have downloaded crashes coda 1.6.10 when it is opened and continues to do so is there something I am missing?? Thankyou in advance
Steve
Hei!
I cannot save settings in coda after install your plugin. Anyone else with this problem?
Greetings.
Markus
Hi -
I assume you clicked “save” :) Could you open the Coda Preferences file located here:
YOUR_HOME_FOLDER/Library/Preferences/com.panic.Coda.plist
(You need a plist-editor, included for example in the Apple Developer Tools)
..and look if you find keys named “dechipwreckCssTidyConfig” or similar? (If you haven’t got an appropriate editor, drop me a mail)
Regards,
mario
There ist no “save”button on global coda-settings. And no, i doent find somethink like “dechipwreck…”.
Okay, misunderstood :) Coda preferences can’t be saved.
Will try to find out if it’s got something to do with the PHP Toolkit and if so, how to resolve. If someone else has the same problem – don’t hesitate to post a comment here.
UPDATE: Problem found, fixed in the upcoming version (the next days I suppose)
The about-windows says v0.96 – is this the latest version?
Eh no, the current version should be 1.62 .. v0.96 is much too old. Simply go to: “your user folder -> Library -> Application support -> Coda -> Plugins”, delete the old PhpToolkit plugin bundle, download the current one and double click it. This should work.
Absolutely awesome. Thanks for this!
This version appears to ignore the ‘Default Line Endings’ set in coda’s preferences?
Set to use windows
http://lulzwut.com/php/before.png
http://lulzwut.com/php/after.png
Hi -
okay, I’ll have a look. One question though: Was that any different in the previous versions?
[UPDATE Jan,25th] And again – no API function from Coda to read the current line endings.. But I’ll try to find a workaround of course..
mario
Huge improvement on version1.6
interface and the way it’s function.
Great work and Thanks
It works great on my G5, thanks for the PPC compatibility.
This is fantastic. Thanks so much!!
When running Tidy PHP I get the following error:
An application error has occurred.
This error will cause instability and it is recommended you quit and relaunch Coda.
(NSInvalidArgumentException) *** -(NSCFArray insertObject:atIndex:]: attempt to insert nil
Running php-toolkit 1.4 with Coda 1.6.7
Any suggestions?
Could you look at the Console output – there should be some more lines .. Or send me the file if possible?
[Update Nov, 26th] No reply until now – so I’ll assume it hasn’t happened again. Otherwise: Send a mail or comment here.
I got the same error “(NSInvalidArgumentException) *** -[NSCFArray insertObject:atIndex:]: attempt to insert nil” here is what console saids.
12/11/09 7:33:04 PM Coda[21547] NSExceptionHandler has recorded the following exception:
NSInvalidArgumentException — *** -[NSCFArray insertObject:atIndex:]: attempt to insert nil
Stack trace: 0×43319a 0×929ebe3b 0×96565dcb 0×96565e0a 0×95a3c660 0×9595a8d4 0×9595a7e4 0×14876743 0×14874ec5 0×95dcdb9b 0×14874d8b 0×95d8be8f 0×95d8bdcc 0×95d8bc52 0×95d8b2ab 0×95d8aafe 0×95d8a3b8 0×95d88af7 0×95d556a5 0×95cb2fe7 0×95c801d8 0×3512 0×3439 0×2
12/11/09 7:33:04 PM Coda[21547] NSExceptionHandler has recorded the following exception:
NSInvalidArgumentException — *** -[NSCFArray insertObject:atIndex:]: attempt to insert nil
Stack trace: 0×43319a 0×929ebe3b 0×96565dcb 0×96565e0a 0×95a3c660 0×9595a8d4 0×9595a7e4 0×14876743 0×14874ec5 0×95dcdb9b 0×14874d8b 0×95d8be8f 0×95d8bdcc 0×95d8bc52 0×95d8b2ab 0×95d8aafe 0×95d8a3b8 0×95d88af7 0×95d556a5 0×95cb2fe7 0×95c801d8 0×3512 0×3439 0×2
I figured out the problem, if you dont save the document you get that error, once you save it and run it again it works fine.
Thx! Just updated the docs – I assume the document was new (=empty before you entered text and saved it) ?
The behaviour of the functions is a little bit inconsistent: php validation and php strip comment take the current editor buffer (regardless of what’s on the disk) – the other functions use the file on disk (so if you don’t save the file might be yet empty).
[UPDATE 1:] The beta version now handles this more graciously (beeps or tells you that you should save the file before).
[UPDATE 2:] One solution would be to save the file automatically (maybe not what everyone wants), another one to create a temp file with the buffer contents (nicer but creates lots of new error possibilites..:). I’ll have a look.
Thanks for the reply, (I got your notification). The document was new but not empty. I created a new document and pasted code from another document and did not save. I used the tidy functionality and that is when I got the error. Once I Saved the file it worked. Thanks for the update though.
Yes..that’s what I meant: The file on disk was still empty.
The beta version (see above) doesn’t have this problem anymore – you can automatically save the file before running CssTidy or PhpTidy. HtmlTidy works now with the current buffer contents (regardless of saving or not).
Awesome. Works a treat. Keep up the great work.
Thanks
Brent
This is great! Looking forward to trying this out! Many thanks for this :-)
This is great – seems to be exactly what Coda was missing for me… However: :)
When I try and validate the PHP I get an error: ‘Errors parsing -’ (with no further error details). If I click ‘Go to line’ nothing happens…
I’m on coda 1.6.5, PHP5.3.0 with Snow Leopard…
Thanks for your help!
Thanks.
Now…: “Go to Line” is a bit tricky if the erroneous line is out of focus.
“Errors parsing – ” is the “correct” answer from php, since the file is directly sent to php (without filename). What happens, if you open the Terminal and enter “php -l yourfile.php” ?
Hi Mario,
Sorry for the delay!
I’ve have tried what you suggest… with the following code error:
With the plugin, I get the ‘Errors parsing – ‘ message.
When I try in terminal I get:
PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in test.php on line 3
Errors parsing test.php
So I guess the plug-in is picking up the second error rather than the first?
if there’s anything else I can try, please let me know.
Best wishes,
Kevin
Yes, it seems the first (and much more interesting) error is either not visible or somehow discarded.
Could it be that the window is too small and hides the first error? It can be resized and reacts somewhat strange then, see the screenshot (click here)
So could you try to restart Coda, maximize the Coda window and drag the error-window at the bottom right handle?
thx,
mario
Just uploaded a new beta version- the window handling is fixed now.
Hey Mario,
No luck I’m afraid… I downloaded the beta and tried that, and can see that the error is now presented in a textarea, but it still just says ‘Errors parsing – ‘.
Let me know if I can do anything else to help identify the issue!
Best wishes,
Kevin
Okay, please download the current beta again, I put in some debugging code. Try validating some erroneous php-file and open the Console (viewing all messages). The error is being reported there like this “Coda PHP Plugin – PHP error: Parse error: syntax error, unexpected T_STRING in – on line 9 Errors parsing -” – what does the Console say?
And: what PHP version is reported in the “About…”-window of the plugin?
Thx for your help.
Hi Mario,
Console is showing:
25/10/2009 17:17:01 Coda[2757] Coda PHP Plugin – PHP error: Errors parsing -
Only other message I receive is about the PHP Plugin starting…
In About PHP Toolkit, local PHP Version is PHP 5.3.0 (cli).
Hope this helps!
Cheers,
Kev
Okay, finally found the error: If you use a php.ini-file (like /private/etc/php.ini) and set “display_errors” to off, this happens.
Hey, for some reason, with certain files, I’m unable to save them after using HTML tidy. Permissions are correct, so I’m not sure what’s going on. Any ideas?
[Updated Nov, 12th] Had seemingly nothing to do with the plugin – a filesystem problem.
Very awesome, thanks a lot!
Mario I keep getting this error when trying to use TidyHTML in Coda 1.6.4:
“Error – No output received in replaceEditorTextWith”
I’ve gotten error this with every type of encoding option,
Any ideas? :(
Vielen Dank!
Is fixed in the latest version.