defaultcontent.install in Default Content 8
Same filename and directory in other branches
File
defaultcontent.installView source
<?php
/**
* Implements hook_install().
* check all existing modules for imported content()
*/
function defaultcontent_install() {
foreach (\Drupal::moduleHandler()
->getModuleList() as $module => $null) {
\Drupal::service('defaultcontent.manager')
->importContent($module);
}
}
/**
* Implements hook_modules_installed().
* check the newly installed modules for existing content.
*/
function defaultcontent_modules_installed($modules) {
// @todo Move this to an event once we have HookEvent.
foreach ($modules as $module) {
if (!\Drupal::isConfigSyncing()) {
\Drupal::service('defaultcontent.manager')
->importContent($module);
}
}
}
Functions
Name | Description |
---|---|
defaultcontent_install | Implements hook_install(). check all existing modules for imported content() |
defaultcontent_modules_installed | Implements hook_modules_installed(). check the newly installed modules for existing content. |