drupal-8.hal-hal_update_8301.php
Contains database additions to drupal-8.bare.standard.php.gz for testing the upgrade path of hal_update_8301().
File
-
core/
modules/ hal/ tests/ fixtures/ update/ drupal-8.hal-hal_update_8301.php
View source
<?php
/**
* @file
* Contains database additions to drupal-8.bare.standard.php.gz for testing the
* upgrade path of hal_update_8301().
*/
use Drupal\Core\Database\Database;
$connection = Database::getConnection();
// Set the schema version.
$connection->insert('key_value')
->fields([
'collection' => 'system.schema',
'name' => 'hal',
'value' => 'i:8000;',
])
->fields([
'collection' => 'system.schema',
'name' => 'serialization',
'value' => 'i:8000;',
])
->execute();
// Update core.extension.
$extensions = $connection->select('config')
->fields('config', [
'data',
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute()
->fetchField();
$extensions = unserialize($extensions);
$extensions['module']['hal'] = 0;
$extensions['module']['serialization'] = 0;
$connection->update('config')
->fields([
'data' => serialize($extensions),
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute();
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.