make cronjobs also classes and began to refactor the whole cronjob stuff

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-19 08:55:23 +01:00
parent a25150babf
commit 903b775f79
52 changed files with 460 additions and 523 deletions

View File

@@ -74,7 +74,7 @@ for ($x = 1; $x < count($argv); $x++) {
$cronlog->setCronDebugFlag(defined('CRON_DEBUG_FLAG'));
$tasks_cnt_stmt = Database::query("SELECT COUNT(*) as jobcnt FROM `panel_tasks`");
$tasks_cnt_stmt = \Froxlor\Database\Database::query("SELECT COUNT(*) as jobcnt FROM `panel_tasks`");
$tasks_cnt = $tasks_cnt_stmt->fetch(PDO::FETCH_ASSOC);
// do we have anything to include?
@@ -88,14 +88,13 @@ if (count($jobs_to_run) > 0) {
if ($tasks_cnt['jobcnt'] > 0)
{
if (Settings::Get('system.nssextrausers') == 1)
if (\Froxlor\Settings::Get('system.nssextrausers') == 1)
{
include_once makeCorrectFile(FROXLOR_INSTALL_DIR.'/scripts/classes/class.Extrausers.php');
Extrausers::generateFiles($cronlog);
\Froxlor\Cron\System\Extrausers::generateFiles($cronlog);
}
// clear NSCD cache if using fcgid or fpm, #1570
if (Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) {
if (\Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int)\Froxlor\Settings::Get('phpfpm.enabled') == 1) {
$false_val = false;
safe_exec('nscd -i passwd 1> /dev/null', $false_val, array('>'));
safe_exec('nscd -i group 1> /dev/null', $false_val, array('>'));