Chris@0: moduleExists('views')) { Chris@0: if (!View::load('watchdog')) { Chris@0: // Save the watchdog view to config. Chris@0: $module_handler = \Drupal::moduleHandler(); Chris@0: $optional_install_path = $module_handler->getModule('dblog')->getPath() . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY; Chris@0: $storage = new FileStorage($optional_install_path); Chris@0: Chris@0: \Drupal::entityTypeManager() Chris@0: ->getStorage('view') Chris@0: ->create($storage->read('views.view.watchdog')) Chris@0: ->save(); Chris@0: Chris@0: return t('The watchdog view has been created.'); Chris@0: } Chris@0: Chris@0: return t("The watchdog view already exists and was not replaced. To replace the 'Recent log messages' with a view, rename the watchdog view and uninstall and install the 'Database Log' module"); Chris@0: } Chris@0: }