function performAdditionalMySQLTests($connection, $dbname)
{
    if (!SchemaSetup::mysqlHasUTF8Encoding($connection, $dbname)) {
        echo json_encode(array("error" => true, "message" => "Your database doesn't have the proper encoding. Please change it using the following SQL statement: <br/><br/><code>ALTER DATABASE " . $dbname . " CHARACTER SET utf8;</code>"));
        exit;
    }
}
Beispiel #2
0
 /**
  * Runs some checks for the CLI setup
  */
 public function runCLIChecks()
 {
     if (PartKeeprConfiguration::getOption("partkeepr.database.driver") == "pdo_mysql") {
         $dbname = PartKeeprConfiguration::getOption("partkeepr.database.dbname");
         if (!SchemaSetup::mysqlHasUTF8Encoding(PartKeepr::getEM()->getConnection(), $dbname)) {
             echo "Error: The database {$dbname} hasn't got the UTF-8 encoding. You need to set the database encoding to UTF-8. Aborting.\n";
             die;
         }
     }
 }