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:
Alexandre Rosenfeld
2011-03-28 18:22:27 -04:00
parent 34a0a5d5e8
commit cbc69e7cc5
2 changed files with 8 additions and 1 deletions

View File

@@ -61,6 +61,13 @@
// register tasks
//TODO: include plugins
$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 (glob("$dir/*.php") as $filename) {

View File

@@ -200,7 +200,7 @@ class workspaceTools {
* @param bool $root wheter to also initialize a root connection
* @return the Propel connection
*/
private function initPropel($root = false) {
public function initPropel($root = false) {
if (($this->initPropel && !$root) || ($this->initPropelRoot && $root))
return;
$wfDetails = $this->getDBCredentials("wf");