Beispiel #1
0
 private function detectDatabases($db_params, $should_drop = false)
 {
     $verify = null;
     foreach ($this->install_config['databases'] as $db) {
         $result = DatabaseUtils::dbExists($db_params, $db);
         if ($result === -1) {
             $verify .= "   Cannot verify if '{$db}' database exists" . PHP_EOL;
         } else {
             if ($result === true) {
                 if (!$should_drop) {
                     $verify .= "   '{$db}' database already exists " . PHP_EOL;
                 } else {
                     logMessage(L_USER, "Dropping '{$db}' database");
                     DatabaseUtils::dropDb($db_params, $db);
                 }
             }
         }
     }
     return $verify;
 }