mirror of
https://github.com/fruithost/Panel.git
synced 2026-11-30 20:35:44 +09:00
28 lines
581 B
PHP
28 lines
581 B
PHP
<?php
|
|
namespace fruithost;
|
|
|
|
class Modules {
|
|
private $core = null;
|
|
private $modules = [];
|
|
|
|
public function __construct($core) {
|
|
$this->core = $core;
|
|
|
|
foreach(new \DirectoryIterator($this->getPath()) AS $info) {
|
|
if($info->isDot()) {
|
|
continue;
|
|
}
|
|
|
|
$this->addModule(new Module(sprintf('%s%s%s', $this->getPath(), DS, $info->getFilename())));
|
|
}
|
|
}
|
|
|
|
public function getPath() {
|
|
return sprintf('%s%s%s', dirname(PATH), DS, 'modules');
|
|
}
|
|
|
|
public function addModule($module) {
|
|
$this->modules[] = $module->init($this->core);
|
|
}
|
|
}
|
|
?>
|