View source
<?php
use Drupal\Core\Database\Database;
$connection = Database::getConnection();
$config = $connection
->select('config')
->fields('config', [
'data',
])
->condition('collection', '')
->condition('name', 'system.mail')
->execute()
->fetchField();
$config = unserialize($config);
$config['interface']['default'] = 'test_mail_collector';
$connection
->update('config')
->fields([
'data' => serialize($config),
'collection' => '',
'name' => 'system.mail',
])
->condition('collection', '')
->condition('name', 'system.mail')
->execute();
$config = $connection
->select('config')
->fields('config', [
'data',
])
->condition('collection', '')
->condition('name', 'system.logging')
->execute()
->fetchField();
$config = unserialize($config);
$config['error_level'] = 'verbose';
$connection
->update('config')
->fields([
'data' => serialize($config),
'collection' => '',
'name' => 'system.logging',
])
->condition('collection', '')
->condition('name', 'system.logging')
->execute();
$config = $connection
->select('config')
->fields('config', [
'data',
])
->condition('collection', '')
->condition('name', 'system.performance')
->execute()
->fetchField();
$config = unserialize($config);
$config['css']['preprocess'] = FALSE;
$config['js']['preprocess'] = FALSE;
$connection
->update('config')
->fields([
'data' => serialize($config),
'collection' => '',
'name' => 'system.performance',
])
->condition('collection', '')
->condition('name', 'system.performance')
->execute();
$config = $connection
->select('config')
->fields('config', [
'data',
])
->condition('collection', '')
->condition('name', 'system.date')
->execute()
->fetchField();
$config = unserialize($config);
$config['timezone']['default'] = 'Australia/Sydney';
$connection
->update('config')
->fields([
'data' => serialize($config),
'collection' => '',
'name' => 'system.date',
])
->condition('collection', '')
->condition('name', 'system.date')
->execute();