Moving updater utils to Server subnamespace, and renaming Autorun to UpdateManager

This commit is contained in:
Pepijn Over 2014-08-06 13:14:41 +02:00
parent 1cd694a145
commit 7913fdaa8a
5 changed files with 13 additions and 13 deletions

View File

@ -44,7 +44,7 @@ if(!defined('PSM_DEBUG') || !PSM_DEBUG) {
} }
psm_update_conf('cron_running_time', $time); psm_update_conf('cron_running_time', $time);
$autorun = new \psm\Util\Updater\Autorun($db); $autorun = new \psm\Util\Server\UpdateManager($db);
$autorun->run(); $autorun->run();
psm_update_conf('cron_running', 0); psm_update_conf('cron_running', 0);

View File

@ -40,7 +40,7 @@ class UpdateController extends AbstractController {
} }
protected function executeIndex() { protected function executeIndex() {
$autorun = new \psm\Util\Updater\Autorun($this->db); $autorun = new \psm\Util\Server\UpdateManager($this->db);
$autorun->setUser($this->user); $autorun->setUser($this->user);
$autorun->run(); $autorun->run();

View File

@ -26,7 +26,7 @@
* @since phpservermon 3.0.0 * @since phpservermon 3.0.0
**/ **/
namespace psm\Util\Updater; namespace psm\Util\Server;
use psm\Service\Database; use psm\Service\Database;
use psm\Service\User; use psm\Service\User;
@ -36,7 +36,7 @@ use psm\Service\User;
* If you provide a User service instance it will be * If you provide a User service instance it will be
* restricted to that user only. * restricted to that user only.
*/ */
class Autorun { class UpdateManager {
/** /**
* Database service * Database service
@ -76,8 +76,8 @@ class Autorun {
$servers = $this->db->query($sql); $servers = $this->db->query($sql);
$updater = new StatusUpdater($this->db); $updater = new Updater\StatusUpdater($this->db);
$notifier = new StatusNotifier($this->db); $notifier = new Updater\StatusNotifier($this->db);
foreach($servers as $server) { foreach($servers as $server) {
$status_old = ($server['status'] == 'on') ? true : false; $status_old = ($server['status'] == 'on') ? true : false;
@ -87,7 +87,7 @@ class Autorun {
} }
// clean-up time!! archive all records // clean-up time!! archive all records
$archive = new \psm\Util\Server\ArchiveManager($this->db); $archive = new ArchiveManager($this->db);
$archive->archive(); $archive->archive();
$archive->cleanup(); $archive->cleanup();
} }

View File

@ -28,10 +28,10 @@
/** /**
* The status updater is for sending notifications to the users. * The status updater is for sending notifications to the users.
* *
* @see \psm\Util\Updater\StatusUpdater * @see \psm\Util\Server\Updater\StatusUpdater
* @see \psm\Util\Updater\Autorun * @see \psm\Util\Server\Updater\Autorun
*/ */
namespace psm\Util\Updater; namespace psm\Util\Server\Updater;
use psm\Service\Database; use psm\Service\Database;
class StatusNotifier { class StatusNotifier {

View File

@ -28,10 +28,10 @@
/** /**
* The status class is for checking the status of a server. * The status class is for checking the status of a server.
* *
* @see \psm\Util\Updater\StatusNotifier * @see \psm\Util\Server\Updater\StatusNotifier
* @see \psm\Util\Updater\Autorun * @see \psm\Util\Server\Updater\Autorun
*/ */
namespace psm\Util\Updater; namespace psm\Util\Server\Updater;
use psm\Service\Database; use psm\Service\Database;
class StatusUpdater { class StatusUpdater {