checkConfigurationToInstall example


        public function isSyncing()
        {
            return $this->lazyLoadItself()->isSyncing();
        }

        /** * {@inheritdoc} */
        public function checkConfigurationToInstall($type$name)
        {
            return $this->lazyLoadItself()->checkConfigurationToInstall($type$name);
        }

    }

}
// Throw an exception if the module name is too long.         if (strlen($module) > DRUPAL_EXTENSION_NAME_MAX_LENGTH) {
          throw new ExtensionNameLengthException("Module name '$module' is over the maximum allowed length of " . DRUPAL_EXTENSION_NAME_MAX_LENGTH . ' characters');
        }

        // Load a new config object for each iteration, otherwise changes made         // in hook_install() are not reflected in $extension_config.         $extension_config = \Drupal::configFactory()->getEditable('core.extension');

        // Check the validity of the default configuration. This will throw         // exceptions if the configuration is not valid.         $config_installer->checkConfigurationToInstall('module', $module);

        // Save this data without checking schema. This is a performance         // improvement for module installation.         $extension_config
          ->set("module.$module", 0)
          ->set('module', module_config_sort($extension_config->get('module')))
          ->save(TRUE);

        // Prepare the new module list, sorted by weight, including filenames.         // This list is used for both the ModuleHandler and DrupalKernel. It         // needs to be kept in sync between both. A DrupalKernel reboot or
if ($installed) {
        continue;
      }

      // Throw an exception if the theme name is too long.       if (strlen($key) > DRUPAL_EXTENSION_NAME_MAX_LENGTH) {
        throw new ExtensionNameLengthException("Theme name $key is over the maximum allowed length of " . DRUPAL_EXTENSION_NAME_MAX_LENGTH . ' characters.');
      }

      // Validate default configuration of the theme. If there is existing       // configuration then stop installing.       $this->configInstaller->checkConfigurationToInstall('theme', $key);

      // The value is not used; the weight is ignored for themes currently. Do       // not check schema when saving the configuration.       $extension_config
        ->set("theme.$key", 0)
        ->save(TRUE);

      // Reset theme settings.       $theme_settings = &drupal_static('theme_get_setting');
      unset($theme_settings[$key]);

      
Home | Imprint | This part of the site doesn't use cookies.