Use composer instead of PEAR to get codesniffer.
Use travis' newer infrastructure.
Try using realpath.
Don't global install.
Merge pull request #184 from cakephp/codesniffer

Use composer instead of PEAR to get codesniffer