File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 4242 "ext-pcre" : " *" ,
4343 "ext-spl" : " *" ,
4444
45- "simplesamlphp/assert" : " ~1.8.1" ,
46- "simplesamlphp/composer-xmlprovider-installer" : " ~1.0.2" ,
47- "symfony/finder" : " ~6.4.0"
45+ "simplesamlphp/assert" : " ~1.8.2" ,
46+ "simplesamlphp/composer-xmlprovider-installer" : " ~1.0.2"
4847 },
4948 "require-dev" : {
50- "simplesamlphp/simplesamlphp-test-framework" : " ~1.9.2 "
49+ "simplesamlphp/simplesamlphp-test-framework" : " ~1.9.3 "
5150 },
5251 "support" : {
5352 "issues" : " https://github.com/simplesamlphp/xml-common/issues" ,
Original file line number Diff line number Diff line change 44
55namespace SimpleSAML \XML \Registry ;
66
7+ use DirectoryIterator ;
78use SimpleSAML \XML \AbstractElement ;
89use SimpleSAML \XML \Assert \Assert ;
910use SimpleSAML \XML \Exception \IOException ;
1011use SimpleSAML \XMLSchema \Exception \InvalidDOMElementException ;
11- use Symfony \Component \Finder \Finder ;
1212
1313use function array_merge_recursive ;
1414use function dirname ;
1515use function file_exists ;
16+ use function preg_match ;
1617
1718final class ElementRegistry
1819{
@@ -29,10 +30,12 @@ private function __construct()
2930 $ classesDir = dirname (__FILE__ , 6 ) . '/vendor/simplesamlphp/composer-xmlprovider-installer/classes ' ;
3031
3132 if (file_exists ($ classesDir ) === true ) {
32- $ finder = Finder::create ()->files ()->name ('element.registry.*.php ' )->in ($ classesDir );
33- if ($ finder ->hasResults ()) {
34- foreach ($ finder as $ file ) {
35- $ this ->importFromFile ($ file ->getPathName ());
33+ $ directory = new DirectoryIterator ($ classesDir );
34+ foreach ($ directory as $ fileInfo ) {
35+ if ($ fileInfo ->isFile ()) {
36+ if (preg_match ('/^element\.registry\.(.*)\.php$/ ' , $ fileInfo ->getFilename ())) {
37+ $ this ->importFromFile ($ fileInfo ->getPathname ());
38+ }
3639 }
3740 }
3841 }
You can’t perform that action at this time.
0 commit comments