示例#1
0
 /**
  * 
  */
 public static function migrateCentreon()
 {
     if (!self::checkForMigration()) {
         Install::installCentreon();
     } else {
         $di = Di::getDefault();
         $config = $di->get('config');
         $dbName = $config->get('db_centreon', 'dbname');
         echo Colorize::colorizeMessage("Starting to migrate to Centreon 3.0", "info") . "\n";
         echo "Preparing Migration... ";
         self::prepareDb();
         echo Colorize::colorizeText('Done', 'green', 'black', true) . "\n";
         echo "Migrating " . Colorize::colorizeText('centreon', 'blue', 'black', true) . " database... ";
         Db::update($dbName);
         echo Colorize::colorizeText('Done', 'green', 'black', true) . "\n";
         $modulesToInstall = self::getCoreModules();
         $dependencyResolver = new Dependency($modulesToInstall['modules']);
         $installOrder = $dependencyResolver->resolve();
         foreach ($installOrder as $moduleName) {
             $currentModule = $modulesToInstall['modules'][$moduleName];
             $moduleInstaller = new $currentModule['classCall']($currentModule['directory'], $currentModule['infos'], 'console');
             echo "Installing " . Colorize::colorizeText($moduleName, 'purple', 'black', true) . " module... ";
             $moduleInstaller->install(false);
             echo Colorize::colorizeText('Done', 'green', 'black', true) . "\n";
         }
         echo Colorize::colorizeMessage("Your Centreon has been successfully migrated to Centreon 3.0", "success") . "\n";
     }
 }
 /**
  * 
  * @param boolean $installDefault
  */
 protected function installDb($installDefault = true)
 {
     echo "Updating " . Colorize::colorizeText('centreon', 'blue', 'black', true) . " database... ";
     Db::update($this->moduleSlug);
     echo Colorize::colorizeText('Done', 'green', 'black', true) . "\n";
     if ($installDefault) {
         Db::loadDefaultDatas($this->moduleDirectory . 'install/datas');
     }
 }
示例#3
0
 /**
  * @todo After seeing Propel
  */
 public function installDb($installDefault = true)
 {
     // Initialize configuration
     $di = Di::getDefault();
     $config = $di->get('config');
     $dbName = $config->get('db_centreon', 'dbname');
     echo "Updating " . Colorize::colorizeText('centreon', 'blue', 'black', true) . " database... ";
     Db::update($dbName);
     echo Colorize::colorizeText('Done', 'green', 'black', true) . "\n";
     if ($installDefault) {
         Db::loadDefaultDatas($this->moduleDirectory . 'install/datas');
     }
 }
示例#4
0
 /**
  * 
  */
 public function generateAction($schema = 'centreon')
 {
     Db::update($schema);
 }
示例#5
0
 protected function loadDatas()
 {
     /* Load from file */
     Db::loadDefaultDatas(__DIR__ . '/data/json/');
     if (false === is_null($this->dataPath)) {
         Db::loadDefaultDatas(CENTREON_PATH . $this->dataPath);
     }
 }