Skip to content

Commit f3f11db

Browse files
author
Julien Jacottet
committed
Fix plugin manager with phar
1 parent 10937bb commit f3f11db

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Automate/PluginManager.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ class PluginManager
2424

2525
public function __construct()
2626
{
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+
}
3434
}
3535
}
3636
}

0 commit comments

Comments
 (0)