Including security review as a submodule - with patched for Yaffs.
[yaffs-website] / web / modules / contrib / bootstrap_layouts / bootstrap_layouts.install
1 <?php
2
3 /**
4  * @file
5  * Install, uninstall and update hooks for the Bootstrap Layouts module.
6  */
7
8 /**
9  * Runs updates for registered update plugins.
10  *
11  * @param int $schema
12  *   The schema version to update.
13  *
14  * @see \Drupal\bootstrap_layouts\BootstrapLayoutsManager::update()
15  *
16  * @throws Exception
17  *   When the "plugin.manager.bootstrap_layouts" service could not be loaded.
18  */
19 function _bootstrap_layouts_update($schema) {
20   $container = \Drupal::getContainer();
21
22   // Rebuild the container if the bootstrap layouts manager doesn't exist.
23   if (!$container->has('plugin.manager.bootstrap_layouts')) {
24     drupal_flush_all_caches();
25   }
26
27   /** @var \Drupal\bootstrap_layouts\BootstrapLayoutsManager $bootstrap_layouts_manager */
28   if ($manager = $container->get('plugin.manager.bootstrap_layouts')) {
29     $manager->update($schema);
30   }
31   else {
32     throw new Exception('Unable to load the "plugin.manager.bootstrap_layouts" service.');
33   }
34 }
35
36 /**
37  * Upgrade existing Bootstrap Layout instances.
38  */
39 function bootstrap_layouts_update_8401() {
40   /** @see \Drupal\bootstrap_layouts\Plugin\BootstrapLayouts\Updates\BootstrapLayoutsUpdate8401 */
41   _bootstrap_layouts_update(8401);
42 }
43
44 /**
45  * Fix "1 Column (stacked)" regions.
46  */
47 function bootstrap_layouts_update_8402() {
48   /** @see \Drupal\bootstrap_layouts\Plugin\BootstrapLayouts\Updates\BootstrapLayoutsUpdate8402 */
49   _bootstrap_layouts_update(8402);
50 }