Add something new to Virb:

Virb

Are you sure you want to delete that?

or Cancel

 

Posted on Jan 5, 2007

TextMate, DockSend, PHP and code that compiles!

Ok so basically this will prevent you from uploading broken PHP.

Open up your Bundle Editor and paste this into the 'Transmit->DockSend File' command:

Enjoy!

SYNTAX=`/usr/bin/php -l $TM_FILEPATH`
SUCCESS="No syntax errors detected in $TM_FILEPATH"

if [ "$SYNTAX" == "$SUCCESS" ];
then
osascript -e "tell application "Transmit" to open POSIX file "$TM_FILEPATH""
else
SEARCH="Errors parsing $TM_FILEPATH"
SYNTAX="${SYNTAX/$SEARCH/}"

SEARCH="parse error, "
SYNTAX="${SYNTAX/$SEARCH/}"

SEARCH="parse error in $TM_FILEPATH "
SYNTAX="${SYNTAX/$SEARCH/}"

SEARCH="in $TM_FILEPATH "
SYNTAX="${SYNTAX/$SEARCH/}"

echo "$SYNTAX"
fi

Loading comments...

Likes

Details

Viewed 716 times

© 2007 Matt

virb.com/t/277
tweet!

Flag this text post!

Flag this text post as:

or Cancel

 

Advertisement

Flag this profile!

Flag this profile as:

or Cancel