das-peter/PHP_CodeSniffer — comment on commit ad0926ba24d4065614ca877ad3fde295ef00ff2e
File:  line 0
By das-peter:

If you call the sniffer like this: `".../php" phpcs.php --report=xml --standard=.../htdocs/drupalcs/Drupal .../htdocs/drupalcs_TestFiles/bad.module`
and the standard uses stuff like this in the ruleset:

*.txt

You end up having an error like this:

Fatal error: Uncaught exception 'PHP_CodeSniffer_Exception' with message 'Referenced sniff Drupal.Commenting.FileComment does not exist' in .../php/pear/PHP/CodeSniffer.php:814
Stack trace:
#0 .../php/pear/PHP/CodeSniffer.php(730): PHP_CodeSniffer->_expandRulesetReference(Object(SimpleXMLElement))
#1 .../php/pear/PHP/CodeSniffer.php(623): PHP_CodeSniffer->getSniffFiles('.../htdocs/drupa...', 'Drupal')
#2 .../php/pear/PHP/CodeSniffer.php(438): PHP_CodeSniffer->setTokenListeners('.../htdocs/drupa...', Array)
#3 .../php/pear/PHP/CodeSniffer/CLI.php(551): PHP_CodeSniffer->process(Array, '.../htdocs/drupa...', Array, false)
#4 .../php/phpcs(38): PHP_CodeSniffer_CLI->process()
#5 {main}
thrown in .../php/pear/PHP/CodeSniffer.php on line 814

This happens because the currently the autoloader doesn't use the path given by the parameter `--standard` for classes to load.
The change above adds code to check if a class or a path is within the path defined by the parameter.