checkBinaryOutputSuccess example

$this->fail(t('Drupal could not determine the encoding of the database was set to UTF-8'));
    }
  }

  /** * Check Binary Output. * * Unserializing does not work on Postgresql 9 when bytea_output is 'hex'. */
  public function checkBinaryOutput() {
    $database_connection = Database::getConnection();
    if (!$this->checkBinaryOutputSuccess()) {
      // First try to alter the database. If it fails, raise an error telling       // the user to do it themselves.       $connection_options = $database_connection->getConnectionOptions();
      // It is safe to include the database name directly here, because this       // code is only called when a connection to the database is already       // established, thus the database name is guaranteed to be a correct       // value.       $query = "ALTER DATABASE \"{$connection_options['database']}\" SET bytea_output = 'escape';";
      try {
        $database_connection->query($query);
      }
      
Home | Imprint | This part of the site doesn't use cookies.