BUG 5978 Allow plugins to set tasks for the CLI
Plugins with a bin/tasks directory will be included in the list of tasks of processmaker CLI.
This commit is contained in:
@@ -61,6 +61,13 @@
|
|||||||
// register tasks
|
// register tasks
|
||||||
//TODO: include plugins
|
//TODO: include plugins
|
||||||
$directories = array(PATH_HOME . 'engine/bin/tasks');
|
$directories = array(PATH_HOME . 'engine/bin/tasks');
|
||||||
|
$pluginsDirectories = glob(PATH_PLUGINS . "*");
|
||||||
|
foreach ($pluginsDirectories as $dir) {
|
||||||
|
if (!is_dir($dir))
|
||||||
|
continue;
|
||||||
|
if (is_dir("$dir/bin/tasks"))
|
||||||
|
$directories[] = "$dir/bin/tasks";
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($directories as $dir) {
|
foreach ($directories as $dir) {
|
||||||
foreach (glob("$dir/*.php") as $filename) {
|
foreach (glob("$dir/*.php") as $filename) {
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ class workspaceTools {
|
|||||||
* @param bool $root wheter to also initialize a root connection
|
* @param bool $root wheter to also initialize a root connection
|
||||||
* @return the Propel connection
|
* @return the Propel connection
|
||||||
*/
|
*/
|
||||||
private function initPropel($root = false) {
|
public function initPropel($root = false) {
|
||||||
if (($this->initPropel && !$root) || ($this->initPropelRoot && $root))
|
if (($this->initPropel && !$root) || ($this->initPropelRoot && $root))
|
||||||
return;
|
return;
|
||||||
$wfDetails = $this->getDBCredentials("wf");
|
$wfDetails = $this->getDBCredentials("wf");
|
||||||
|
|||||||
Reference in New Issue
Block a user