Mercurial > hg > isophonics-drupal-site
comparison core/modules/system/tests/fixtures/update/drupal-8.update-test-postupdate-enabled.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 /** | |
4 * @file | |
5 * Partial database to mimic the installation of the update_test_post_update | |
6 * module. | |
7 */ | |
8 | |
9 use Drupal\Core\Database\Database; | |
10 | |
11 $connection = Database::getConnection(); | |
12 | |
13 // Set the schema version. | |
14 $connection->merge('key_value') | |
15 ->condition('collection', 'system.schema') | |
16 ->condition('name', 'update_test_postupdate') | |
17 ->fields([ | |
18 'collection' => 'system.schema', | |
19 'name' => 'update_test_postupdate', | |
20 'value' => 'i:8000;', | |
21 ]) | |
22 ->execute(); | |
23 | |
24 // Update core.extension. | |
25 $extensions = $connection->select('config') | |
26 ->fields('config', ['data']) | |
27 ->condition('collection', '') | |
28 ->condition('name', 'core.extension') | |
29 ->execute() | |
30 ->fetchField(); | |
31 $extensions = unserialize($extensions); | |
32 $extensions['module']['update_test_postupdate'] = 8000; | |
33 $connection->update('config') | |
34 ->fields([ | |
35 'data' => serialize($extensions), | |
36 ]) | |
37 ->condition('collection', '') | |
38 ->condition('name', 'core.extension') | |
39 ->execute(); |