Skip to content

Commit

Permalink
Dev: Fixed issue runtimePath badly set for cron command
Browse files Browse the repository at this point in the history
Dev: set to actual directory/tmp (then must be launched in ls directory to work)
  • Loading branch information
Shnoulle committed Dec 15, 2016
1 parent 1cd8839 commit 3368bce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 1 addition & 4 deletions application/commands/PluginCommand.php
Expand Up @@ -17,14 +17,11 @@ class PluginCommand extends CConsoleCommand

public function actionCron($interval)
{

$pm = \Yii::app()->pluginManager;
$event = new PluginEvent('cron');
$event->set('interval', $interval);
$pm->dispatchEvent($event);


}
}

?>
?>
7 changes: 6 additions & 1 deletion application/commands/console.php
Expand Up @@ -36,7 +36,12 @@
}
unset ($config['defaultController']);
unset ($config['config']);
$config['runtimePath']=$settings['tempdir'].'/runtime';
/* fix tempdir for runtime path, unsure you can lauch function anywhere (if you use php /var/www/limesurvey/... : can be /root/ for config */
$tempdir=$settings['tempdir'];
if(!is_dir($tempdir)){
$tempdir=str_replace($settings['rootdir'],dirname(dirname(dirname(__FILE__))),$settings['tempdir']);
}
$config['runtimePath']=$tempdir.'/runtime';

// fix for fcgi
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
Expand Down

0 comments on commit 3368bce

Please sign in to comment.