About

User

You are logged in as Anonymous.

Want to log out?

PHP Dashboard Widget

*blows the dust off his blog*

Hi everybody!

I've (yet again) let my blog become stagnant. I just can't seem to find the time/ambition to update it, regularly.

Brief news: I switched to a Mac, a few weeks ago (more on this below), php|tek was awesome, and the latest podcast is up (thanks Sara).

As I mentioned, I made the switch to Mac, a few weeks ago. It was relatively painless for me. There were a few things I needed to do to make it functional (set up pseudo-virtual-desktops, for example). I've been tinkering with all-things-Mac for a while, now, which leads to this post.

I've created a dashboard widget that I find really useful, and I figured I might as well share it.

Here's the link, but more after the jump: http://www.phpdoc.info/widgets/php.wdgt.zipI found myself using php -r on the command line to test some simple code snippets, and it occurred to me that this isn't "The Mac Way."

So, following the excellent documentation at Apple, I managed to come up with something pretty useful in an afternoon.

Note: you'll need to flip the widget over and set the proper PHP path, if it doesn't work out of the box.

Let me know if you run into any trouble, and I'll attempt to fix it.

Hope this helps someone. I find myself using it all the time.


10 Responses to PHP Dashboard Widget

  1. 251 Alexey Zakhlestin 2007-06-02 11:26

    Nice idea :)
    I am not a big fan of dashboard, but I wll definitely give it a try. I do a lot of "php -r" these days too ;)

  2. 252 Dennis 2007-06-02 11:55

    I did something similar with an AppleScript that I trigger with a key command from within BBEdit. It passes the current selection (or the current line if nothing is selected) to "php -r" and prints the output immediately below. The output is automatically selected, so it can be quickly deleted afterwards. It's very convenient for testing bits of code in place as I skim a file.

    I imagine this sort of thing could be done with many other text editors as well. But I'll also give the widget a try. It might be a nice addition to my workflow. Thanks for posting it!

  3. 253 Chris D 2007-06-02 16:52

    Humm....

    How about a widget that you could drop the latest PHP source tarball onto and it will automatically compile and install?

    BTW, if you haven't already looked at it, try out TextMate. It is an astounding piece of software for a measly price.

  4. 254 Ian 2007-06-02 17:43

    Sweet! I'm adding this to my DB! Now all I gotta do is find space...

  5. 255 Alexey Zakhlestin 2007-06-03 07:05

    That wouldn't make much sense, as everyone has different requirements for compilation

  6. 256 Eduo 2007-06-05 16:12

    Extending this idea. Does this mean it's feasible that PHP can be used to do behaviour for a widget?

    I say this because I'd like to develop something for my mac, but I'm not proficient in anything other than web-based languages. I'd feel comfortable trying it out in a widget if all the behaviour could be done in PHP.

  7. 257 sf 2007-06-12 04:00

    cool stuff ;)

  8. 258 Anonymous 2007-08-23 09:58

    Can anybody tell me what the path is for this widget on a standard install of mac os x please. I have PHP working and tried a number of paths (/usr/local/php5 and variations) but not getting any response from the widget

  9. 259 jonny 2007-09-10 11:03

    try this and it should work, its the full path to php

    /usr/local/php5/bin/php

  10. 260 ljubiccica 2008-02-19 04:58

    Great thing this widget!

    And for everybody trying to find path to php: you can use nice command in ternimal - [b]which[/b]

    Usage:

    [i]# which php[/i]

    and you get something like:

    [i]/usr/local/bin/php[/i]

Leave a Reply




Clicky Web Analytics