33 lines
722 B
PHP
Executable File
33 lines
722 B
PHP
Executable File
<?php
|
|
|
|
|
|
namespace Workflow;
|
|
|
|
|
|
class AssistentManager
|
|
{
|
|
public function getAvailableAssistents() {
|
|
$filePath = MODULE_ROOTPATH . DS . 'extends' . DS . 'assistents' . DS . '*' . DS . 'Assistent.php';
|
|
|
|
$files = glob($filePath);
|
|
|
|
$assistents = array();
|
|
|
|
foreach($files as $file) {
|
|
require_once($file);
|
|
|
|
$key = basename(dirname($file));
|
|
|
|
$className = '\\Workflow\\Plugins\\Assistents\\' . $key;
|
|
|
|
$assistent = new $className($key);
|
|
|
|
$assistents[$key] = array(
|
|
'name' => $assistent->getName(),
|
|
'description' => $assistent->getDescription()
|
|
);
|
|
}
|
|
|
|
return $assistents;
|
|
}
|
|
} |