Skip to content

Commit 1b54ce2

Browse files
committed
Fixed bug #1591 : Autoloader failing to load arbitrary files when installed_paths only set via a custom ruleset
1 parent 10eb14a commit 1b54ce2

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
5656
- PHP_CodeSniffer\Files\File::findExtendedClassName() now supports extended interfaces
5757
-- Thanks to Martin Hujer for the patch
5858
- Fixed bug #1577 : Generic.InlineControlStructureSniff breaks with a comment between body and condition in do while loops
59+
- Fixed bug #1591 : Autoloader failing to load arbitrary files when installed_paths only set via a custom ruleset
5960
- Fixed bug #1605 : Squiz.WhiteSpace.OperatorSpacing false positive on unary minus after comment
6061
-- Thanks to Juliette Reinders Folmer for the patch
6162
</notes>

src/Config.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,6 +1561,15 @@ public static function setConfigData($key, $value, $temp=false)
15611561

15621562
self::$configData = $phpCodeSnifferConfig;
15631563

1564+
// If the installed paths are being set, make sure all known
1565+
// standards paths are added to the autoloader.
1566+
if ($key === 'installed_paths') {
1567+
$installedStandards = Util\Standards::getInstalledStandardDetails();
1568+
foreach ($installedStandards as $name => $details) {
1569+
Autoload::addSearchPath($details['path'], $details['namespace']);
1570+
}
1571+
}
1572+
15641573
return true;
15651574

15661575
}//end setConfigData()

0 commit comments

Comments
 (0)