- added multiserver-client-deploy-cron
- outsourcing Deploy() function from froxlorclient to client_deployer
This commit is contained in:
@@ -25,6 +25,10 @@ require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.10.apache
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.15.apache_fcgid.php'));
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.20.lighttpd.php'));
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.25.lighttpd_fcgid.php'));
|
||||
// only include if multiserver is enabled
|
||||
if($settings['multiserver']['enabled']) {
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.multiserver.client_deploy.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* LOOK INTO TASKS TABLE TO SEE IF THERE ARE ANY UNDONE JOBS
|
||||
@@ -375,6 +379,36 @@ while($row = $db->fetch_array($result_tasks))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TYPE=9 -> deploy a Froxlor multiserver client to its destination
|
||||
*/
|
||||
elseif ($row['type'] == '9')
|
||||
{
|
||||
fwrite($debugHandler, ' cron_tasks: Task9 started - deploy a Froxlor multiserver client' . "\n");
|
||||
$cronlog->logAction(CRON_ACTION, LOG_INFO, 'Task9 started - deploy a Froxlor multiserver client');
|
||||
|
||||
if(is_array($row['data']))
|
||||
{
|
||||
if(isset($row['data']['serverid']))
|
||||
{
|
||||
/*
|
||||
* get froxlor-client-object
|
||||
*/
|
||||
$client = froxlorclient::getInstance(null, $db, (int)$row['data']['serverid']);
|
||||
/*
|
||||
* create new deployer-object
|
||||
*/
|
||||
$deployer = new client_deployer($client);
|
||||
/*
|
||||
* deploy
|
||||
*
|
||||
* @TODO handle Exceptions
|
||||
*/
|
||||
$deployer->Deploy();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($db->num_rows($result_tasks) != 0)
|
||||
|
||||
Reference in New Issue
Block a user