From 4aec62825b0ac61736ba0873483ec79c04331756 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Thu, 26 May 2011 15:39:08 -0400 Subject: [PATCH] BUG 0000 adding a missing folder workflow/engine/bin/plugins --- .gitignore | 1 - workflow/engine/bin/cron_single.php | 39 +++++++++++++++----------- workflow/engine/bin/plugins/.gitignore | 1 + 3 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 workflow/engine/bin/plugins/.gitignore diff --git a/.gitignore b/.gitignore index d3b8c6f02..e9e6884f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -.gitignore nbproject workflow/engine/config/paths_installed.php gulliver/thirdparty/html2ps_pdf/cache diff --git a/workflow/engine/bin/cron_single.php b/workflow/engine/bin/cron_single.php index 0bad10b64..acc997e76 100755 --- a/workflow/engine/bin/cron_single.php +++ b/workflow/engine/bin/cron_single.php @@ -243,24 +243,29 @@ function executePlugins(){ global $sFilter; if($sFilter!='' && strpos($sFilter, 'plugins') === false) return false; - $pathCronPlugins = PATH_CORE.'bin'.PATH_SEP.'plugins'.PATH_SEP; - if ($handle = opendir( $pathCronPlugins )) { - while ( false !== ($file = readdir($handle))) { - if ( strpos($file, '.php',1) && is_file($pathCronPlugins . $file) ) { + $pathCronPlugins = PATH_CORE.'bin'.PATH_SEP.'plugins'.PATH_SEP; + + //erik: verify if the plugin dir exists + if (!is_dir($pathCronPlugins)) { + return false; + } + + if ($handle = opendir( $pathCronPlugins )) { + while ( false !== ($file = readdir($handle))) { + if ( strpos($file, '.php',1) && is_file($pathCronPlugins . $file) ) { + $filename = str_replace('.php' , '', $file) ; + $className = $filename . 'ClassCron'; - $filename = str_replace('.php' , '', $file) ; - $className = $filename . 'ClassCron'; - - include_once ( $pathCronPlugins . $file ); //$filename. ".php" - $oPlugin = new $className(); - if (method_exists($oPlugin, 'executeCron')) { - $oPlugin->executeCron(); - setExecutionMessage("Executing Pentaho Reports Plugin"); - setExecutionResultMessage('DONE'); - } - } - } - } + include_once ( $pathCronPlugins . $file ); //$filename. ".php" + $oPlugin = new $className(); + if (method_exists($oPlugin, 'executeCron')) { + $oPlugin->executeCron(); + setExecutionMessage("Executing Pentaho Reports Plugin"); + setExecutionResultMessage('DONE'); + } + } + } + } } function calculateDuration() { global $sFilter; diff --git a/workflow/engine/bin/plugins/.gitignore b/workflow/engine/bin/plugins/.gitignore new file mode 100644 index 000000000..c2d6083e9 --- /dev/null +++ b/workflow/engine/bin/plugins/.gitignore @@ -0,0 +1 @@ +#some files to ignore