File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,13 @@ class PluginManager
24
24
25
25
public function __construct ()
26
26
{
27
- foreach (glob (__DIR__ .'/Plugin/*Plugin.php ' ) as $ filename ) {
28
- $ file = new \ SplFileInfo ( $ filename );
29
- $ class = 'Automate \\Plugin \\' . substr ($ file ->getFilename (), 0 , -4 );
30
-
31
- $ ref = new \ ReflectionClass ( $ class );
32
- if (! $ ref -> isAbstract () && $ ref -> implementsInterface (PluginInterface:: class)) {
33
- $ this -> plugins [] = new $ class ;
27
+ foreach (new \ DirectoryIterator (__DIR__ .'/Plugin/ ' ) as $ file ) {
28
+ if ( $ file-> isFile ()) {
29
+ $ class = 'Automate \\Plugin \\' . substr ($ file ->getFilename (), 0 , -4 );
30
+ $ ref = new \ ReflectionClass ( $ class );
31
+ if (! $ ref -> isAbstract () && $ ref -> implementsInterface (PluginInterface:: class)) {
32
+ $ this -> plugins [] = new $ class;
33
+ }
34
34
}
35
35
}
36
36
}
You can’t perform that action at this time.
0 commit comments