public static function getInstance($dbType)
 {
     if ($dbType == WAPDB::DB_CONCIERGE) {
         if (is_null(self::$concierge)) {
             $config = new WAPConciergeConfig();
             $maintenanceClass = $config->getMaintenanceClassName();
             self::$concierge = new $maintenanceClass($config);
         }
         return self::$concierge;
     } elseif ($dbType == WAPDB::DB_BABELFISH) {
         if (is_null(self::$babelfish)) {
             $config = new WAPBabelfishConfig();
             $maintenanceClass = $config->getMaintenanceClassName();
             self::$babelfish = new $maintenanceClass($config);
         }
         return self::$babelfish;
     } elseif ($dbType == WAPDB::DB_EDITFISH) {
         if (is_null(self::$editfish)) {
             $config = new WAPEditfishConfig();
             $maintenanceClass = $config->getMaintenanceClassName();
             self::$editfish = new $maintenanceClass($config);
         }
         return self::$editfish;
     } else {
         throw new Exception('No valid system provided');
     }
 }
Esempio n. 2
0
<?php

define('WH_USE_BACKUP_DB', true);
require_once 'commandLine.inc';
$maintenance = WAPMaintenance::getInstance(WAPDB::DB_BABELFISH);
$maintenance->nightly();
Esempio n. 3
0
<?php

define('WH_USE_BACKUP_DB', true);
require_once 'commandLine.inc';
$maintenance = WAPMaintenance::getInstance(WAPDB::DB_CONCIERGE);
$maintenance->nightly();
Esempio n. 4
0
<?php

define('WH_USE_BACKUP_DB', true);
require_once 'commandLine.inc';
$maintenance = WAPMaintenance::getInstance(WAPDB::DB_EDITFISH);
$maintenance->nightly();