Coda PHP & Web Toolkit

  1. Download / Feedback •
  2. Help
  3. Coda Tips

AboutDownloadComments/Feedback

A Coda plugin aimed at PHP & Web development – not in active development.

Current version: 4.1 – Coda 1 and Coda 2

Features

  1. (Automatic) PHP syntax validation with jump to error and auto-save
  2. Clean up/reformat HTML, CSS, Javascript and PHP code (configurable)
  3. HTML, CSS and Javascript validation
  4. Minify Javascript and CSS
  5. Automatic check for updates
  6. It’s free (you can donate of course)

All features use the editor buffer (no need to save first) – Works with local and remote files – Written in Cocoa/ObjC.

General Preferences Preferences for CSS Preferences for Javascript Validation with errors Validation successful

Download

Download Coda PHP & Web Toolkit 4.1 »

Download Coda PHP & Web Toolkit 4.2 beta »

Sourcecode

https://bitbucket.org/mariofischer/php-web-toolkit/


Changelog »

Problems?

First have a look here » – if that doesn’t help, please write a comment below.

Enjoy using this plugin?

Great!
Just leave a comment or donate (via paypal) ».

For German users I can only recommend all-inkl.com (Partnerlink).

Planned Features

  • Apply some functions only to the selected area if desired (DONE – in the current beta)
  • Floating result windows/Growl-like notification/Use Growl (DONE – in the current beta)
  • Switch online validators more easy (DONE – in the current beta)
  • Rewrite curl methods in cocoa
  • Add configuration options for JSTidy
  • Automatically install updates
  • Use Coda 2 API for go to line (DONE – in the current beta)
  • Use Coda 2 API for automatic PHP validation before saving
  • Up next: Minify JS/CSS automatically on publishing
  • CSS minify: Check other minifier
  • Respect spaces per indent (in different cases)
  • PHP tidy: Preserve whitespaces, if possible
  • Minification: Upload .min.css or similar, if possible
  • Check new HTML5 tidy
  • Javascript execution directly via cocoa (improvement necessary)
  • Make PHP tidy more configurable (if possible)

782 Replies to “Coda PHP & Web Toolkit”

  1. I had a quick question…I noticed that when I use the html tidy option it automatically changes my doctype to strict when I would like it to stay in transitional…is there any way to change that so that it doesn’t change my doctype declaration? thanks in advance for any advice…ps. I love this plugin minus this small issue.

        1. This should work, I tried it with this doctype:

          !DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”

          Otherwise send me the HTML-file, then I’ll have look.

  2. Hi Mario

    I contacted earlier just thought you might want the crash report error:

    Link (dyld) error:

    Symbol not found: _objc_setProperty
    Referenced from: /Users/KT/Library/Application Support/Coda/Plug-ins/PhpPlugin.codaplugin/Contents/MacOS/PhpPlugin
    Expected in: /usr/lib/libobjc.A.dylib

    Thanks

    Steve

    1. Hi –

      okay, some additional questions:

      So Coda runs without the plugin normally? The plugin crash happens at startup? Which OSX-Version and which platform (ppc/intel ~ 32bit/64bit) do you use?

      thx,
      mario

      1. Hi Mario
        Coda runs okay until the plugin is installed then I delete the plugin file to get it working correctly I am using osx 10.4.11 Intel Core duo (not sure on 32-64bit??)

        Do you want the crash report?

        Thanks again

        Steve

        1. Hi –

          yes, please – could you send me the logfile via email? mario (at) chipwreck (dot) de

          OSX 10.4 is 32bit – maybe 10.4 is the problem, since I haven’t been able to test it on 10.4.

        2. Hi again –

          I’m afraid the code isn’t compatible with OS X 10.4 (according to Xcode) – so if you’ve got any chance to upgrade to 10.5/10.6 the plugin should run without problems.

          1. I think i will upgrade – thanks for all your effort and I look forward to using the plugin after upgrade. If there is anything I can do for you just let me know

            Thanks again

            Steve

  3. Hi

    I have tried to download the phptoolkit for coda which looks great. Only problem is it crashes coda when it starts and continues to do so, is there something I am missing ?? I am running MAMP and coda 1.6.10

    Thanks in advance

    Steve

  4. 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

    1. 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

        1. 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)

    1. 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.

    1. 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

  5. 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?

    1. 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.

      1. 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: 0x43319a 0x929ebe3b 0x96565dcb 0x96565e0a 0x95a3c660 0x9595a8d4 0x9595a7e4 0x14876743 0x14874ec5 0x95dcdb9b 0x14874d8b 0x95d8be8f 0x95d8bdcc 0x95d8bc52 0x95d8b2ab 0x95d8aafe 0x95d8a3b8 0x95d88af7 0x95d556a5 0x95cb2fe7 0x95c801d8 0x3512 0x3439 0x2
        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: 0x43319a 0x929ebe3b 0x96565dcb 0x96565e0a 0x95a3c660 0x9595a8d4 0x9595a7e4 0x14876743 0x14874ec5 0x95dcdb9b 0x14874d8b 0x95d8be8f 0x95d8bdcc 0x95d8bc52 0x95d8b2ab 0x95d8aafe 0x95d8a3b8 0x95d88af7 0x95d556a5 0x95cb2fe7 0x95c801d8 0x3512 0x3439 0x2

        1. 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.

          1. 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.

            1. 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.

              1. 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).

  6. 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!

    1. 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” ?

      1. 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

        1. 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

          1. 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

            1. 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.

            2. 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

  7. 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!

    1. I’ll have a look :) At the moment I’m trying to integrate the W3C Validator which is not that easy, since the API misses some methods needed..

      But thanks for the suggestion.

  8. At last! This means I can use coda as a proper development tool :) Thank you.

    After I run php tidy in 1.6.4 all the end of line characters start to show – switching invisible characters on / off does nothing. How can I hide them?

    1. Two questions: Do other invisible characters (like “->” for tabs) also appear and in which encoding is the php-file? You could also send me a small file in which those problems appear (see Contact for my mailaddress)

      Regards,
      Mario

  9. Great plugin, thank you! Coming from textmate, this is exactly the thing I missed (and which caused me to stay in textmate). I hope ISO-8859-1 support is coming soon. UTF-8 is great of course, but if you have older sites that you don’t want to convert, more encodings would help.

    1. The new version supports more encodings – you have to select the encoding, since the API doesn’t yet tell me which the right one is, but this should help :)

  10. Hi,
    Just wondering, I’m trying to use the Tidy HTML feature, but I’m getting “Error – No output received” … I’m on Mac OS X Tiger – does it matter only for the PHP features, or also the HTML? What to do?
    Thanks
    G

    1. Yes, you need at least Leopard (or php5 installed) for the PHP-specific features (I updated the requirements above). But HTML tidy should work nevertheless. Could you try it out with another HTML-File? Or send me one per mail, which makes problems..

      Hope this helps.

  11. Seems to fail on 1.6.3. I’m getting this error using php tidy:

    Parse error: parse error, expecting `T_VARIABLE’ or `’$” in /Users/aaron/Library/Application Support/Coda/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/phptidy-coda.php on line 387

    I hope this can be fixed, I’ve been looking for a PHP plugin for a while!

    Aaron

    1. Hi –

      this shouldn’t have to anything with the 1.6.3 release. Do you encounter this also with other php-files? If possible, could you mail the offending php-file to me?
      Another thing to check: Open the Terminal, enter “php -v” (without quotes) and return – what result do you get?

      regards,
      mario

      1. Thanks for the fast reply!

        I’ve tried it on multiple files, including nearly empty ones. ( fails) It might be that my php version is out of date? Does this work on php < 5?

        aaron-mac:~ aaron$ php -v
        PHP 4.4.9 (cli) (built: Sep 17 2008 14:54:01)
        Copyright (c) 1997-2008 The PHP Group
        Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

        1. Yes, php4 – that’s the problem. With php5 everything should work. Which OS X version do you use? In the current Leopard release php5 is included.

          You can install a more recent php-version with MacPorts, but therefore you have to edit the path to php in the first line of the “phptidy-coda.php”-file.
          Hope that helps.

          1. Yes I’m on Tiger, that’s why. I’ll look into upgrading. Thanks again for your efforts and support on this plug-in.

  12. Thank you for contributing to the Coda community ! Using this plugin daily, saves me alot of time switching back between terminal windows!

    Cheers !

  13. This is awesome thank you!
    Would it be possible to add a feature which lets you find an opening bracket’s closing bracket (and vice versa)? I know Coda has a feature which highlights them but its no use when there is lots of code between the brackets.!

    1. Thanks :)

      The bracket highlighting is at the moment not possible – for the Coda-API allows only a limited set of actions like replacing text, opening files etc., but no features like highlighting text.

      Besides this would also be not easy writing such a feature (and doing it better than the Coda developers :)

Leave a Reply to tim Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.