Tasks::checkEncoding

protected function Tasks::checkEncoding

protected Tasks::checkEncoding()

Check encoding is UTF8.

File

core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php, line 114

Class

Tasks
Specifies installation tasks for PostgreSQL databases.

Namespace

Drupal\Core\Database\Driver\pgsql\Install

Code

protected function checkEncoding() {
  try {
    if (db_query('SHOW server_encoding')->fetchField() == 'UTF8') {
      $this->pass(t('Database is encoded in UTF-8'));
    }
    else {
      $this->fail(t('The %driver database must use %encoding encoding to work with Drupal. Recreate the database with %encoding encoding. See <a href="drupal_8-core-lib-drupal-core-database-driver-pgsql-install-tasks-php-function-tasks-checkencoding-INSTALL-pgsql-txt.html?lang=en">INSTALL.pgsql.txt</a> for more details.', array(
        '%encoding' => 'UTF8',
        '%driver' => $this->name(),
      )));
    }
  }
  catch (\Exception $e) {
    $this->fail(t('Drupal could not determine the encoding of the database was set to UTF-8'));
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!Driver!pgsql!Install!Tasks.php/function/Tasks::checkEncoding/8.1.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部