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)

795 Replies to “Coda PHP & Web Toolkit”

  1. Hello,
    I use your plugin since years and i love it.
    Yesterday i upgrade to Monterey (MacOs 12.2.1) and then an error appeared when i save php file :
    “Sorry, we have an exception.
    NSInvalidArgumentException
    Reason: launch path not accessible”
    Then :
    “PHP returned nothing
    Make sure the file has no errors, try using UTF-8 encoding.”

    Of course i check encoding type and confirm to use UTF-8 encoding.

    That error appears on every php file when i save them.

    Do you know a way to fix this error ?

    Best regards

    1. I was running into the same errors, and for me, I needed to do two things.

      1. Update PHP using homebrew and

      2. Update the path to “/usr/local/bin/php”

      Updating PHP required me to update Homebrew using the following procedure taken from https://github.com/httpie/httpie/issues/645#issuecomment-456902997

      “Just Run below command

      1)brew doctor

      2)sudo chown -R $(whoami) $(brew –prefix)/*

      3)sudo install -d -o $(whoami) -g admin /usr/local/Frameworks

      I hope this helps!

  2. Hi,

    I’ve recently upgraded to a new M1 MacBook Pro. I’m now getting an error when validating php files..

    Sorry, we have an exception
    NSInvalidArgumentException
    Reason:
    launch path not accessible

    Is there anything I can do to fix this?

    1. Hi,
      the plugin is discontinued but maybe the php binary is not set up correctly in the settings? It should be something like “/usr/bin/php”.

      1. I was running into the same errors, and for me, I needed to do two things. 1. Update PHP using homebrew and 2. Update the path to “/usr/local/bin/php”

        Updating PHP required me to update Homebrew using the following procedure taken from https://github.com/httpie/httpie/issues/645#issuecomment-456902997

        “Just Run below command

        1)brew doctor

        2)sudo chown -R $(whoami) $(brew –prefix)/*

        3)sudo install -d -o $(whoami) -g admin /usr/local/Frameworks

        I hope this helps someone else!

  3. Just wondering;
    Is it possible to hook in to the validator in coda?

    And the error message is barely readable when dark mode is activated. The white color behind the letters is not a good choice. Can we edit this?

  4. Hello! Do you plan on building a version of this PHP/Toolkit plugin for Panic’s new Nova editor?

  5. I’m trying to tidy up HTML with your plugin but I’m getting this error:
    (I have updated the plugin, running Coda 2.75)
    Any ideas?

    Sorry, we have an exception.
    NSInvalidArgumentException
    Reason:
    *** -[NSConcreteTask terminate]: task not launched

    1. Hi –

      since I don’t continue the development anymore, it’s a bit difficult to help here. But you can turn on debug mode in the preferences, open Console on your Mac, try again and have a look at the console output. There should be a log message showing which command the plugin was trying to execute.

  6. Is there an option to not add an extra linebreak after a comment (//comment or /*comment*/) in the JS tidy?

  7. Tried to run tidy CSS on a .less file, and boy that messed it up :) Would be nice to be able to auto-tab those files as well, but realize that’s a bit different.

    1. Hi –

      PHP 7+ is supported. The plugin uses the PHP binary installed with OS X on your Mac (/usr/bin/php).
      If you use an older OS X version (where PHP 7.1 is not included yet) you can install a newer PHP version (via Homebrew for example).
      Then simply the the path to the new php binary in the settings.

      1. Ahhh gotcha. That explains it then.
        I was wondering why PHP validation was throwing an error when I used something like:
        $username = $_GET[‘user’] ?? ‘nobody’;

        But I found that on my work computer, I have PHP 5.6 installed.
        On my personal computer, I have PHP 7 and everything is working great.

        Thanks for the speedy response. And also, big thanks for the development of this Coda plugin. I can say without doubt that I use it more than any other, and it honestly fills the gap in my decision of what IDE to use. Phenomenal!

  8. Hi,
    I’m using semanticUI which uses an i TAG to display predefined icons.
    Tidy always removes them with the warning “Warning: trimming empty “.

    I tried adding this i to the various new-xx-tags parts, but to no avail.

    Help and FAQ do not help or answer Q. Neither does my google-fu.

    anyone? ;-)
    thanks
    simon

  9. Hi,

    I’m on Coda 2.6.9 / Mac OS 10.13.1 Hight Sierra and unable to use “Tidy javascript” command.

    I confirm my file is encoded in UTF-8.

    I have following errors :

    Make sure the file has no errors, try using UTF-8 encoding.

    Fatal error: Uncaught Error: Function name must be a string in /Users/fabrice/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php:193
    Stack trace:
    #0 /Users/fabrice/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php(80): JSBeautifier->beautify(‘(function(){var…’, Object(BeautifierOptions))
    #1 /Users/fabrice/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php(1202): js_beautify(‘(function(){var…’, Object(BeautifierOptions))
    #2 {main}
    thrown in /Users/fabrice/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php on line 193

    1. I fixed by myself.
      1 – Open /Users/[YOUR USER NAME]/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php
      2 – At line 162, modify:
      $handlers = array…
      by
      $this->$handlers… (just make $handlers part of the class)
      3 – At line 193 replace the wrong function call:
      $this->$handlers[$token_type]($token_text);
      by the correctly call:
      call_user_func(array($this, $this->$handlers[$token_type]), $token_text);
      4 – Save the file.

          1. Same Problem for CSSMinify:

            CSSMinify exception received.
            Make sure the file has no errors, try using UTF-8 encoding.

            Any ideas?

  10. -Coda 2 (2.6.7)
    -High Sierra

    Make sure the file has no errors, try using UTF-8 encoding.

    Fatal error: Uncaught Error: Function name must be a string in /Users/carlo/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php:193
    Stack trace:
    #0 /Users/carlo/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php(80): JSBeautifier->beautify(‘$(document).rea…’, Object(BeautifierOptions))
    #1 /Users/carlo/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php(1202): js_beautify(‘\t$(document).re…’, Object(BeautifierOptions))
    #2 {main}
    thrown in /Users/carlo/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php on line 193

  11. Hello, I’m unable to run “Tidy Javascript” on macOS 10.13 High Sierra, I get this error:

    JSTidy exception received.

    Make sure the file has no errors, try using UTF-8 encoding.

    Fatal error: Uncaught Error: Function name must be a string in /Users/matteo/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php:193
    Stack trace:
    #0 /Users/matteo/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php(80): JSBeautifier->beautify(‘if(lang===”EN”)…’, Object(BeautifierOptions))
    #1 /Users/matteo/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php(1202): js_beautify(‘if(lang===”EN”)…’, Object(BeautifierOptions))
    #2 {main}
    thrown in /Users/matteo/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php on line 193

    From the log I see this:

    Sep 26 16:13:03 MacBook-Pro Coda 2[5759]: [Coda PHP Toolkit] Executing at path /usr/bin/php with (
    “-n”,
    “-f”,
    “/Users/matteo/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/jsbeautifier.php”,
    “–“,
    “indent_char_tab,”,
    LF
    )

    Everything was working correctly yesterday before jumping on 10.13…. any hint?

    Thanks!

Leave a Reply to Justin Scarpetti 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.