Skip to content

Commit

Permalink
Fixed bug #1591 : Autoloader failing to load arbitrary files when ins…
Browse files Browse the repository at this point in the history
…talled_paths only set via a custom ruleset
  • Loading branch information
gsherwood committed Aug 16, 2017
1 parent 10eb14a commit 1b54ce2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- PHP_CodeSniffer\Files\File::findExtendedClassName() now supports extended interfaces
-- Thanks to Martin Hujer for the patch
- Fixed bug #1577 : Generic.InlineControlStructureSniff breaks with a comment between body and condition in do while loops
- Fixed bug #1591 : Autoloader failing to load arbitrary files when installed_paths only set via a custom ruleset
- Fixed bug #1605 : Squiz.WhiteSpace.OperatorSpacing false positive on unary minus after comment
-- Thanks to Juliette Reinders Folmer for the patch
</notes>
Expand Down
9 changes: 9 additions & 0 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,15 @@ public static function setConfigData($key, $value, $temp=false)

self::$configData = $phpCodeSnifferConfig;

// If the installed paths are being set, make sure all known
// standards paths are added to the autoloader.
if ($key === 'installed_paths') {
$installedStandards = Util\Standards::getInstalledStandardDetails();
foreach ($installedStandards as $name => $details) {
Autoload::addSearchPath($details['path'], $details['namespace']);
}
}

return true;

}//end setConfigData()
Expand Down

0 comments on commit 1b54ce2

Please sign in to comment.