Command-line PHP Syntax Checker

Posted in Programming Tips on December 1st, 2011 by Daniel Spiteri – Be the first to comment

Here’s a useful command alias to add to your .bash_profile:

alias phpcheckr='find ./ -type f -name \*.php -exec php -l {} \; | grep -v "No syntax errors"'

This nifty little command recursively traverses all of your directories for php files and runs a syntax check on them. If there are no errors the output is hidden. Enjoy.

Default install of Cocos2d in Xcode 4.2 = Xcode Errors

Posted in Programming Tips on December 1st, 2011 by Daniel Spiteri – Be the first to comment

If you just downloaded and installed cocos2d and a bunch of errors are appearing in your very first default project, like “unknown type CCDirector”, try installing cocos2d via git using the terminal.

http://www.cocos2d-iphone.org/download

$ git clone git://github.com/cocos2d/cocos2d-iphone.git
$ git checkout develop
$ git pull
$ cd cocos2d-iphone
$ ./install-templates.sh -f -u

This got rid of all those fatal errors that Xcode couldn’t resolve.

If you don’t have git, well, just grab it here:

http://git-scm.com/