Permalink
Browse files

Allow aliased standards via symlinks.

  • Loading branch information...
1 parent c717874 commit 5de1faaa66730a165e9bb72fa28780b38d6c30c4 @ktomk ktomk committed May 12, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 CodeSniffer.php
View
@@ -612,7 +612,7 @@ public function setTokenListeners($standard, array $sniffs=array())
$standard = (string) $ruleset['name'];
} else {
- self::$standardDir = realpath(dirname(__FILE__).'/CodeSniffer/Standards/'.$standard);
+ self::$standardDir = realpath(dirname(__FILE__).'/CodeSniffer/Standards').DIRECTORY_SEPARATOR.$standard;
if (is_dir(self::$standardDir) === false) {
// This isn't looking good. Let's see if this
// is a relative path to a custom standard.
@@ -819,7 +819,7 @@ private function _expandRulesetReference($sniff)
$sniff = basename($path);
} else if (is_file($sniff) === false) {
// See if this is a whole standard being referenced.
- $path = realpath(dirname(__FILE__).'/CodeSniffer/Standards/'.$sniff);
+ $path = realpath(dirname(__FILE__).'/CodeSniffer/Standards').DIRECTORY_SEPARATOR.$sniff;
if (is_dir($path) === true) {
$isDir = true;
} else {
@@ -831,7 +831,7 @@ private function _expandRulesetReference($sniff)
}
$path = $parts[0].'/Sniffs/'.$parts[1].'/'.$parts[2].'Sniff.php';
- $path = realpath(dirname(__FILE__).'/CodeSniffer/Standards/'.$path);
+ $path = realpath(dirname(__FILE__).'/CodeSniffer/Standards').DIRECTORY_SEPARATOR.$path;
if ($path === false && self::$standardDir !== '') {
// The sniff is not locally installed, so check if it is being
// referenced as a remote sniff outside the install. We do this by

0 comments on commit 5de1faa

Please sign in to comment.