diff --git a/core/includes/errors.inc b/core/includes/errors.inc index 5fc4b7d..16afc4d 100644 --- a/core/includes/errors.inc +++ b/core/includes/errors.inc @@ -153,7 +153,12 @@ function _drupal_render_exception_safe($exception) { * TRUE if an error should be displayed. */ function error_displayable($error = NULL) { - $error_level = config('system.logging')->get('error_level'); + try { + $error_level = config('system.logging')->get('error_level'); + } + catch (Exception $e) { + $error_level = ERROR_REPORTING_DISPLAY_ALL; + } $updating = (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update'); $all_errors_displayed = ($error_level == ERROR_REPORTING_DISPLAY_ALL) || ($error_level == ERROR_REPORTING_DISPLAY_VERBOSE); @@ -254,7 +259,12 @@ function _drupal_log_error($error, $fatal = FALSE) { $message = format_string('%type: !message in %function (line %line of %file).', $error); // Check if verbose error reporting is on. - $error_level = config('system.logging')->get('error_level'); + try { + $error_level = config('system.logging')->get('error_level'); + } + catch (Exception $e) { + $error_level = ERROR_REPORTING_DISPLAY_ALL; + } if ($error_level == ERROR_REPORTING_DISPLAY_VERBOSE) { // First trace is the error itself, already contained in the message. diff --git a/core/lib/Drupal/Core/Config/FileStorageFactory.php b/core/lib/Drupal/Core/Config/FileStorageFactory.php new file mode 100644 index 0000000..f581378 --- /dev/null +++ b/core/lib/Drupal/Core/Config/FileStorageFactory.php @@ -0,0 +1,29 @@ +registerCache($container); - // Register active configuration storage. - $container - ->register('config.cachedstorage.storage', 'Drupal\Core\Config\FileStorage') - ->addArgument(config_get_config_directory(CONFIG_ACTIVE_DIRECTORY)); - $container - ->register('config.storage', 'Drupal\Core\Config\CachedStorage') - ->addArgument(new Reference('config.cachedstorage.storage')) - ->addArgument(new Reference('cache.config')); - - $container->register('config.context.factory', 'Drupal\Core\Config\Context\ConfigContextFactory') - ->addArgument(new Reference('event_dispatcher')); - - $container->register('config.context', 'Drupal\Core\Config\Context\ContextInterface') - ->setFactoryService(new Reference('config.context.factory')) - ->setFactoryMethod('get') - ->addTag('persist'); - - // Register a config context with no overrides for use in administration - // forms, enabling modules and importing configuration. - $container->register('config.context.free', 'Drupal\Core\Config\Context\ContextInterface') - ->setFactoryService(new Reference('config.context.factory')) - ->setFactoryMethod('get') - ->addArgument('Drupal\Core\Config\Context\FreeConfigContext'); - - $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory') - ->addArgument(new Reference('config.storage')) - ->addArgument(new Reference('config.context')) - ->addTag('persist'); - - // Register staging configuration storage. - $container - ->register('config.storage.staging', 'Drupal\Core\Config\FileStorage') - ->addArgument(config_get_config_directory(CONFIG_STAGING_DIRECTORY)); - - // Register import snapshot configuration storage. - $container - ->register('config.storage.snapshot', 'Drupal\Core\Config\DatabaseStorage') - ->addArgument(new Reference('database')) - ->addArgument('config_snapshot'); - - // Register schema configuration storage. - $container - ->register('config.storage.schema', 'Drupal\Core\Config\Schema\SchemaStorage'); - - // Register the typed configuration data manager. - $container->register('config.typed', 'Drupal\Core\Config\TypedConfigManager') - ->addArgument(new Reference('config.storage')) - ->addArgument(new Reference('config.storage.schema')); - - // Register the service for the default database connection. - $container->register('database', 'Drupal\Core\Database\Connection') - ->setFactoryClass('Drupal\Core\Database\Database') - ->setFactoryMethod('getConnection') - ->addArgument('default'); - // Register the KeyValueStore factory. - $container - ->register('keyvalue', 'Drupal\Core\KeyValueStore\KeyValueFactory') - ->addArgument(new Reference('service_container')); - $container - ->register('keyvalue.database', 'Drupal\Core\KeyValueStore\KeyValueDatabaseFactory') - ->addArgument(new Reference('database')); - // Register the KeyValueStoreExpirable factory. - $container - ->register('keyvalue.expirable', 'Drupal\Core\KeyValueStore\KeyValueExpirableFactory') - ->addArgument(new Reference('service_container')); - $container - ->register('keyvalue.expirable.database', 'Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory') - ->addArgument(new Reference('database')) - ->addTag('needs_destruction'); - - $container->register('settings', 'Drupal\Component\Utility\Settings') - ->setFactoryClass('Drupal\Component\Utility\Settings') - ->setFactoryMethod('getSingleton'); - - // Register the State k/v store as a service. - $container->register('state', 'Drupal\Core\KeyValueStore\KeyValueStoreInterface') - ->setFactoryService(new Reference('keyvalue')) - ->setFactoryMethod('get') - ->addArgument('state'); - - // Register the Queue factory. - $container - ->register('queue', 'Drupal\Core\Queue\QueueFactory') - ->addArgument(new Reference('settings')) - ->addMethodCall('setContainer', array(new Reference('service_container'))); - $container - ->register('queue.database', 'Drupal\Core\Queue\QueueDatabaseFactory') - ->addArgument(new Reference('database')); - - $container->register('path.alias_whitelist', 'Drupal\Core\Path\AliasWhitelist') - ->addArgument('path_alias_whitelist') - ->addArgument('cache') - ->addArgument(new Reference('keyvalue')) - ->addArgument(new Reference('database')) - ->addTag('needs_destruction'); - - $container->register('path.alias_manager', 'Drupal\Core\Path\AliasManager') - ->addArgument(new Reference('database')) - ->addArgument(new Reference('path.alias_whitelist')) - ->addArgument(new Reference('language_manager')); - - $container->register('http_client_simpletest_subscriber', 'Drupal\Core\Http\Plugin\SimpletestHttpRequestSubscriber'); - $container->register('http_default_client', 'Guzzle\Http\Client') - ->addArgument(NULL) - ->addArgument(array( - 'curl.CURLOPT_TIMEOUT' => 30.0, - 'curl.CURLOPT_MAXREDIRS' => 3, - )) - ->addMethodCall('addSubscriber', array(new Reference('http_client_simpletest_subscriber'))) - ->addMethodCall('setUserAgent', array('Drupal (+http://drupal.org/)')); - - // Register the EntityManager. - $container->register('plugin.manager.entity', 'Drupal\Core\Entity\EntityManager') - ->addArgument('%container.namespaces%'); - // The 'request' scope and service enable services to depend on the Request // object and get reconstructed when the request object changes (e.g., // during a subrequest). $container->addScope(new Scope('request')); - $container->register('request', 'Symfony\Component\HttpFoundation\Request'); - - $container->register('event_dispatcher', 'Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher') - ->addArgument(new Reference('service_container')); - $container->register('controller_resolver', 'Drupal\Core\ControllerResolver') - ->addArgument(new Reference('service_container')); - - $this->registerModuleHandler($container); - - $container->register('http_kernel', 'Drupal\Core\HttpKernel') - ->addArgument(new Reference('event_dispatcher')) - ->addArgument(new Reference('service_container')) - ->addArgument(new Reference('controller_resolver')); - - // Register the 'language_manager' service. - $container->register('language_manager', 'Drupal\Core\Language\LanguageManager'); - - $container->register('database.slave', 'Drupal\Core\Database\Connection') - ->setFactoryClass('Drupal\Core\Database\Database') - ->setFactoryMethod('getConnection') - ->addArgument('slave'); - $container->register('typed_data', 'Drupal\Core\TypedData\TypedDataManager') - ->addMethodCall('setValidationConstraintManager', array(new Reference('validation.constraint'))); - $container->register('validation.constraint', 'Drupal\Core\Validation\ConstraintManager') - ->addArgument('%container.namespaces%'); - - // Add the user's storage for temporary, non-cache data. - $container->register('lock', 'Drupal\Core\Lock\DatabaseLockBackend'); - $container->register('user.tempstore', 'Drupal\user\TempStoreFactory') - ->addArgument(new Reference('database')) - ->addArgument(new Reference('lock')); - $this->registerTwig($container); - $this->registerRouting($container); - - // Add the entity query factories. - $container->register('entity.query', 'Drupal\Core\Entity\Query\QueryFactory') - ->addArgument(new Reference('plugin.manager.entity')) - ->addMethodCall('setContainer', array(new Reference('service_container'))); - $container->register('entity.query.config', 'Drupal\Core\Config\Entity\Query\QueryFactory') - ->addArgument(new Reference('config.storage')); - - $container->register('router.dumper', 'Drupal\Core\Routing\MatcherDumper') - ->addArgument(new Reference('database')); - $container->register('router.builder', 'Drupal\Core\Routing\RouteBuilder') - ->addArgument(new Reference('router.dumper')) - ->addArgument(new Reference('lock')) - ->addArgument(new Reference('event_dispatcher')) - ->addArgument(new Reference('module_handler')); - - $container->register('path.alias_manager.cached', 'Drupal\Core\CacheDecorator\AliasManagerCacheDecorator') - ->addArgument(new Reference('path.alias_manager')) - ->addArgument(new Reference('cache.path')); - - $container->register('path.crud', 'Drupal\Core\Path\Path') - ->addArgument(new Reference('database')) - ->addArgument(new Reference('path.alias_manager')); - - // Add password hashing service. The argument to PhpassHashedPassword - // constructor is the log2 number of iterations for password stretching. - // This should increase by 1 every Drupal version in order to counteract - // increases in the speed and power of computers available to crack the - // hashes. The current password hashing method was introduced in Drupal 7 - // with a log2 count of 15. - $container->register('password', 'Drupal\Core\Password\PhpassHashedPassword') - ->addArgument(16); - - // The following services are tagged as 'route_filter' services and are - // processed in the RegisterRouteFiltersPass compiler pass. - $container->register('mime_type_matcher', 'Drupal\Core\Routing\MimeTypeMatcher') - ->addTag('route_filter'); - - $container->register('paramconverter_manager', 'Drupal\Core\ParamConverter\ParamConverterManager') - ->addTag('route_enhancer'); - $container->register('paramconverter.entity', 'Drupal\Core\ParamConverter\EntityConverter') - ->addArgument(new Reference('plugin.manager.entity')) - ->addTag('paramconverter'); - - $container->register('router_processor_subscriber', 'Drupal\Core\EventSubscriber\RouteProcessorSubscriber') - ->addArgument(new Reference('content_negotiation')) - ->addTag('event_subscriber'); - $container->register('router_listener', 'Symfony\Component\HttpKernel\EventListener\RouterListener') - ->addArgument(new Reference('router')) - ->addTag('event_subscriber'); - $container->register('content_negotiation', 'Drupal\Core\ContentNegotiation'); - $container->register('view_subscriber', 'Drupal\Core\EventSubscriber\ViewSubscriber') - ->addArgument(new Reference('content_negotiation')) - ->addTag('event_subscriber'); - $container->register('legacy_access_subscriber', 'Drupal\Core\EventSubscriber\LegacyAccessSubscriber') - ->addTag('event_subscriber'); - $container->register('access_manager', 'Drupal\Core\Access\AccessManager') - ->addMethodCall('setContainer', array(new Reference('service_container'))); - $container->register('access_subscriber', 'Drupal\Core\EventSubscriber\AccessSubscriber') - ->addArgument(new Reference('access_manager')) - ->addTag('event_subscriber'); - $container->register('access_check.default', 'Drupal\Core\Access\DefaultAccessCheck') - ->addTag('access_check'); - $container->register('maintenance_mode_subscriber', 'Drupal\Core\EventSubscriber\MaintenanceModeSubscriber') - ->addTag('event_subscriber'); - $container->register('path_subscriber', 'Drupal\Core\EventSubscriber\PathSubscriber') - ->addArgument(new Reference('path.alias_manager.cached')) - ->addArgument(new Reference('path_processor_manager')) - ->addTag('event_subscriber'); - $container->register('legacy_request_subscriber', 'Drupal\Core\EventSubscriber\LegacyRequestSubscriber') - ->addTag('event_subscriber'); - $container->register('legacy_controller_subscriber', 'Drupal\Core\EventSubscriber\LegacyControllerSubscriber') - ->addTag('event_subscriber'); - $container->register('finish_response_subscriber', 'Drupal\Core\EventSubscriber\FinishResponseSubscriber') - ->addArgument(new Reference('language_manager')) - ->setScope('request') - ->addTag('event_subscriber'); - $container->register('request_close_subscriber', 'Drupal\Core\EventSubscriber\RequestCloseSubscriber') - ->addArgument(new Reference('module_handler')) - ->addTag('event_subscriber'); - $container->register('config_global_override_subscriber', 'Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber') - ->addTag('event_subscriber'); - $container->register('language_request_subscriber', 'Drupal\Core\EventSubscriber\LanguageRequestSubscriber') - ->addArgument(new Reference('language_manager')) - ->addTag('event_subscriber'); - - $container->register('exception_controller', 'Drupal\Core\ExceptionController') - ->addArgument(new Reference('content_negotiation')) - ->addMethodCall('setContainer', array(new Reference('service_container'))); - $container->register('exception_listener', 'Symfony\Component\HttpKernel\EventListener\ExceptionListener') - ->addTag('event_subscriber') - ->addArgument(array(new Reference('exception_controller'), 'execute')); - - $this->registerPathProcessors($container); - - $container - ->register('transliteration', 'Drupal\Core\Transliteration\PHPTransliteration'); - - $container->register('flood', 'Drupal\Core\Flood\DatabaseBackend') - ->addArgument(new Reference('database')); - - $container->register('plugin.manager.condition', 'Drupal\Core\Condition\ConditionManager'); - - $container->register('kernel_destruct_subscriber', 'Drupal\Core\EventSubscriber\KernelDestructionSubscriber') - ->addMethodCall('setContainer', array(new Reference('service_container'))) - ->addTag('event_subscriber'); + $this->registerModuleHandler($container); - // Register Ajax event subscriber. - $container->register('ajax.subscriber', 'Drupal\Core\Ajax\AjaxSubscriber') - ->addTag('event_subscriber'); + // The argument to the hashing service defined in services.yml, to the + // constructor of PhpassHashedPassword is the log2 number of iterations + // for password stretching. This should increase by 1 every Drupal version + // in order to counteract increases in the speed and power of computers + // available to crack the hashes. The current password hashing method was + // introduced in Drupal 7 with a log2 count of 15. - // Register image toolkit manager. - $container - ->register('image.toolkit.manager', 'Drupal\system\Plugin\ImageToolkitManager') - ->addArgument('%container.namespaces%'); - // Register image toolkit. - $container - ->register('image.toolkit', 'Drupal\system\Plugin\ImageToolkitInterface') - ->setFactoryService('image.toolkit.manager') - ->setFactoryMethod('getDefaultToolkit'); $container->addCompilerPass(new RegisterMatchersPass()); $container->addCompilerPass(new RegisterRouteFiltersPass()); @@ -325,6 +64,9 @@ public function build(ContainerBuilder $container) { $container->addCompilerPass(new RegisterRouteEnhancersPass()); // Add a compiler pass for registering services needing destruction. $container->addCompilerPass(new RegisterServicesForDestructionPass()); + // Add the compiler pass that will process the tagged services. + $container->addCompilerPass(new RegisterPathProcessorsPass()); + $container->addCompilerPass(new ListCacheBinsPass()); } /** @@ -347,42 +89,6 @@ protected function registerModuleHandler(ContainerBuilder $container) { } /** - * Registers the various services for the routing system. - * - * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container - */ - protected function registerRouting(ContainerBuilder $container) { - $container->register('router.request_context', 'Symfony\Component\Routing\RequestContext') - ->addMethodCall('fromRequest', array(new Reference('request'))); - - $container->register('router.route_provider', 'Drupal\Core\Routing\RouteProvider') - ->addArgument(new Reference('database')); - $container->register('router.matcher.final_matcher', 'Drupal\Core\Routing\UrlMatcher'); - $container->register('router.matcher', 'Symfony\Cmf\Component\Routing\NestedMatcher\NestedMatcher') - ->addArgument(new Reference('router.route_provider')) - ->addMethodCall('setFinalMatcher', array(new Reference('router.matcher.final_matcher'))); - $container->register('router.generator', 'Drupal\Core\Routing\UrlGenerator') - ->addArgument(new Reference('router.route_provider')) - ->addArgument(new Reference('path.alias_manager.cached')); - $container->register('router.dynamic', 'Symfony\Cmf\Component\Routing\DynamicRouter') - ->addArgument(new Reference('router.request_context')) - ->addArgument(new Reference('router.matcher')) - ->addArgument(new Reference('router.generator')); - - $container->register('legacy_generator', 'Drupal\Core\Routing\NullGenerator'); - $container->register('legacy_url_matcher', 'Drupal\Core\LegacyUrlMatcher'); - $container->register('legacy_router', 'Symfony\Cmf\Component\Routing\DynamicRouter') - ->addArgument(new Reference('router.request_context')) - ->addArgument(new Reference('legacy_url_matcher')) - ->addArgument(new Reference('legacy_generator')); - - $container->register('router', 'Symfony\Cmf\Component\Routing\ChainRouter') - ->addMethodCall('setContext', array(new Reference('router.request_context'))) - ->addMethodCall('add', array(new Reference('router.dynamic'))) - ->addMethodCall('add', array(new Reference('legacy_router'))); - } - - /** * Registers Twig services. */ public static function registerTwig(ContainerBuilder $container) { @@ -413,49 +119,4 @@ public static function registerTwig(ContainerBuilder $container) { ->addMethodCall('addExtension', array(new Definition('Twig_Extension_Debug'))); } - /** - * Register services related to path processing. - */ - protected function registerPathProcessors(ContainerBuilder $container) { - // Register the path processor manager service. - $container->register('path_processor_manager', 'Drupal\Core\PathProcessor\PathProcessorManager'); - // Register the processor that urldecodes the path. - $container->register('path_processor_decode', 'Drupal\Core\PathProcessor\PathProcessorDecode') - ->addTag('path_processor_inbound', array('priority' => 1000)); - // Register the processor that resolves the front page. - $container->register('path_processor_front', 'Drupal\Core\PathProcessor\PathProcessorFront') - ->addArgument(new Reference('config.factory')) - ->addTag('path_processor_inbound', array('priority' => 200)); - // Register the alias path processor. - $container->register('path_processor_alias', 'Drupal\Core\PathProcessor\PathProcessorAlias') - ->addArgument(new Reference('path.alias_manager')) - ->addTag('path_processor_inbound', array('priority' => 100)); - - // Add the compiler pass that will process the tagged services. - $container->addCompilerPass(new RegisterPathProcessorsPass()); - } - - /** - * Register services related to cache. - */ - protected function registerCache(ContainerBuilder $container) { - // This factory chooses the backend service for a given bin. - $container - ->register('cache_factory', 'Drupal\Core\Cache\CacheFactory') - ->addArgument(new Reference('settings')) - ->addMethodCall('setContainer', array(new Reference('service_container'))); - // These are the core provided backend services. - $container - ->register('cache.backend.database', 'Drupal\Core\Cache\DatabaseBackendFactory') - ->addArgument(new Reference('database')); - $container - ->register('cache.backend.memory', 'Drupal\Core\Cache\MemoryBackendFactory'); - // Register a service for each bin for injecting purposes. - foreach (array('bootstrap', 'config', 'cache', 'menu', 'page', 'path') as $bin) { - CacheFactory::registerBin($container, $bin); - } - - $container->addCompilerPass(new ListCacheBinsPass()); - } - } diff --git a/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php b/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php new file mode 100644 index 0000000..5733b2d --- /dev/null +++ b/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php @@ -0,0 +1,236 @@ +container = $container; + } + + public function load($filename) { + $content = $this->loadFile($filename); + $content += array('parameters' => array(), 'services' => array()); + // parameters + foreach ($content['parameters'] as $key => $value) { + $this->container->setParameter($key, $this->resolveServices($value)); + } + // services + foreach ($content['services'] as $id => $service) { + $this->parseDefinition($id, $service, $filename); + } + } + + /** + * Parses a definition. + * + * Copied from \Symfony\Component\DependencyInjection\Loader\YamlFileLoader::parseDefinition(). + * + * @param string $id + * @param array $service + * @param string $filename + * + * @throws \InvalidArgumentException When tags are invalid + */ + protected function parseDefinition($id, $service, $filename) { + if (is_string($service) && 0 === strpos($service, '@')) { + $this->container->setAlias($id, substr($service, 1)); + return; + } + elseif (isset($service['alias'])) { + $public = !array_key_exists('public', $service) || (Boolean) $service['public']; + $this->container->setAlias($id, new Alias($service['alias'], $public)); + return; + } + if (isset($service['parent'])) { + $definition = new DefinitionDecorator($service['parent']); + } + else { + $definition = new Definition(); + } + + if (isset($service['class'])) { + $definition->setClass($service['class']); + } + + if (isset($service['scope'])) { + $definition->setScope($service['scope']); + } + + if (isset($service['synthetic'])) { + $definition->setSynthetic($service['synthetic']); + } + + if (isset($service['public'])) { + $definition->setPublic($service['public']); + } + + if (isset($service['abstract'])) { + $definition->setAbstract($service['abstract']); + } + + if (isset($service['factory_class'])) { + $definition->setFactoryClass($service['factory_class']); + } + + if (isset($service['factory_method'])) { + $definition->setFactoryMethod($service['factory_method']); + } + + if (isset($service['factory_service'])) { + $definition->setFactoryService($service['factory_service']); + } + + if (isset($service['file'])) { + $definition->setFile($service['file']); + } + + if (isset($service['arguments'])) { + $definition->setArguments($this->resolveServices($service['arguments'])); + } + + if (isset($service['properties'])) { + $definition->setProperties($this->resolveServices($service['properties'])); + } + + if (isset($service['configurator'])) { + if (is_string($service['configurator'])) { + $definition->setConfigurator($service['configurator']); + } + else { + $definition->setConfigurator(array($this->resolveServices($service['configurator'][0]), $service['configurator'][1])); + } + } + + if (isset($service['calls'])) { + foreach ($service['calls'] as $call) { + $args = isset($call[1]) ? $this->resolveServices($call[1]) : array(); + $definition->addMethodCall($call[0], $args); + } + } + + if (isset($service['tags'])) { + if (!is_array($service['tags'])) { + throw new \InvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s" in %s.', $id, $filename)); + } + + foreach ($service['tags'] as $tag) { + if (!isset($tag['name'])) { + throw new \InvalidArgumentException(sprintf('A "tags" entry is missing a "name" key for service "%s" in %s.', $id, $filename)); + } + + $name = $tag['name']; + unset($tag['name']); + + foreach ($tag as $value) { + if (!is_scalar($value)) { + throw new \InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s" in %s.', $id, $name, $filename)); + } + } + + $definition->addTag($name, $tag); + } + } + + $this->container->setDefinition($id, $definition); + } + + /** + * Loads a YAML file. + * + * @param string ,$filename + * + * @return array The file content + */ + protected function loadFile($filename) { + $parser = new Parser(); + return $this->validate($parser->parse(file_get_contents($filename)), $filename); + } + + /** + * Validates a YAML file. + * + * @param mixed $content + * @param string $filename + * + * @return array + * + * @throws \InvalidArgumentException When service file is not valid + */ + protected function validate($content, $filename) { + if (NULL === $content) { + return $content; + } + + if (!is_array($content)) { + throw new \InvalidArgumentException(sprintf('The service file "%s" is not valid: it is not an array.', $filename)); + } + if ($keys = array_diff_key($content, array('parameters' => TRUE, 'services' => TRUE))) { + $invalid_keys = htmlspecialchars(implode(', ', $keys), ENT_QUOTES, 'UTF-8'); + throw new \InvalidArgumentException(sprintf('The service file "%s" is not valid: it contains invalid keys %s.', $filename, $invalid_keys)); + } + + return $content; + } + + /** + * Resolves services. + * + * Copied from \Symfony\Component\DependencyInjection\Loader\YamlFileLoader::parseDefinition(). + * + * @param string $value + * + * @return Reference + */ + protected function resolveServices($value) { + if (is_array($value)) { + $value = array_map(array($this, 'resolveServices'), $value); + } + elseif (is_string($value) && 0 === strpos($value, '@')) { + if (0 === strpos($value, '@?')) { + $value = substr($value, 2); + $invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE; + } + else { + $value = substr($value, 1); + $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE; + } + + if ('=' === substr($value, -1)) { + $value = substr($value, 0, -1); + $strict = FALSE; + } + else { + $strict = TRUE; + } + + $value = new Reference($value, $invalidBehavior, $strict); + } + + return $value; + } + +} diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index ee14fb3..c4ef2bf 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -11,6 +11,7 @@ use Drupal\Core\Config\BootstrapConfigStorageFactory; use Drupal\Core\CoreBundle; use Drupal\Core\DependencyInjection\ContainerBuilder; +use Drupal\Core\DependencyInjection\YamlFileLoader; use Symfony\Component\ClassLoader\UniversalClassLoader; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; @@ -100,6 +101,13 @@ class DrupalKernel extends Kernel implements DrupalKernelInterface { protected $containerNeedsDumping; /** + * Holds the list of YAML files containing service definitions. + * + * @var array + */ + protected $serviceYamls; + + /** * Constructs a DrupalKernel object. * * @param string $environment @@ -160,6 +168,9 @@ public function registerBundles() { $bundles = array( new CoreBundle(), ); + $this->serviceYamls = array( + 'core/services.yml' + ); $this->bundleClasses = array('Drupal\Core\CoreBundle'); // Ensure we know what modules are enabled and that their namespaces are @@ -168,7 +179,8 @@ public function registerBundles() { $module_list = $this->configStorage->read('system.module'); $this->moduleList = isset($module_list['enabled']) ? $module_list['enabled'] : array(); } - $this->registerNamespaces($this->getModuleNamespaces($this->getModuleFileNames())); + $module_filenames = $this->getModuleFileNames(); + $this->registerNamespaces($this->getModuleNamespaces($module_filenames)); // Load each module's bundle class. foreach ($this->moduleList as $module => $weight) { @@ -178,6 +190,10 @@ public function registerBundles() { $bundles[] = new $class(); $this->bundleClasses[] = $class; } + $filename = dirname($module_filenames[$module]) . "/services.yml"; + if (file_exists($filename)) { + $this->serviceYamls[] = $filename; + } } // Add site specific or test bundles. @@ -382,6 +398,12 @@ protected function buildContainer() { foreach ($this->bundles as $bundle) { $bundle->build($container); } + $yaml_loader = new YamlFileLoader($container); + foreach ($this->serviceYamls as $filename) { + if (file_exists($filename)) { + $yaml_loader->load($filename); + } + } $container->setParameter('persistIds', array_keys($container->findTaggedServiceIds('persist'))); $container->compile(); return $container; diff --git a/core/modules/aggregator/lib/Drupal/aggregator/AggregatorBundle.php b/core/modules/aggregator/lib/Drupal/aggregator/AggregatorBundle.php deleted file mode 100644 index 2782029..0000000 --- a/core/modules/aggregator/lib/Drupal/aggregator/AggregatorBundle.php +++ /dev/null @@ -1,29 +0,0 @@ -register("plugin.manager.aggregator.$type", 'Drupal\aggregator\Plugin\AggregatorPluginManager') - ->addArgument($type) - ->addArgument('%container.namespaces%'); - } - } - -} diff --git a/core/modules/aggregator/services.yml b/core/modules/aggregator/services.yml new file mode 100644 index 0000000..7652b8e --- /dev/null +++ b/core/modules/aggregator/services.yml @@ -0,0 +1,11 @@ + +services: + plugin.manager.aggregator.fetcher: + class: Drupal\aggregator\Plugin\AggregatorPluginManager + arguments: [fetcher, '%container.namespaces%'] + plugin.manager.aggregator.parser: + class: Drupal\aggregator\Plugin\AggregatorPluginManager + arguments: [parser, '%container.namespaces%'] + plugin.manager.aggregator.processor: + class: Drupal\aggregator\Plugin\AggregatorPluginManager + arguments: [processor, '%container.namespaces%'] diff --git a/core/modules/ban/lib/Drupal/ban/BanBundle.php b/core/modules/ban/lib/Drupal/ban/BanBundle.php deleted file mode 100644 index e9a92bb..0000000 --- a/core/modules/ban/lib/Drupal/ban/BanBundle.php +++ /dev/null @@ -1,29 +0,0 @@ -register('ban.ip_manager', 'Drupal\ban\BanIpManager') - ->addArgument(new Reference('database')); - $container->register('ban.subscriber', 'Drupal\ban\EventSubscriber\BanSubscriber') - ->addArgument(new Reference('ban.ip_manager')) - ->addTag('event_subscriber'); - } -} diff --git a/core/modules/ban/services.yml b/core/modules/ban/services.yml new file mode 100644 index 0000000..9164569 --- /dev/null +++ b/core/modules/ban/services.yml @@ -0,0 +1,10 @@ + +services: + ban.ip_manager: + class: Drupal\ban\BanIpManager + arguments: ['@database'] + ban.subscriber: + class: Drupal\ban\EventSubscriber\BanSubscriber + tags: + - { name: event_subscriber } + arguments: ['@ban.ip_manager'] diff --git a/core/modules/block/lib/Drupal/block/BlockBundle.php b/core/modules/block/lib/Drupal/block/BlockBundle.php deleted file mode 100644 index 1dd86e1..0000000 --- a/core/modules/block/lib/Drupal/block/BlockBundle.php +++ /dev/null @@ -1,29 +0,0 @@ -register('plugin.manager.block', 'Drupal\block\Plugin\Type\BlockManager') - ->addArgument('%container.namespaces%'); - CacheFactory::registerBin($container, 'block'); - } - -} diff --git a/core/modules/block/services.yml b/core/modules/block/services.yml new file mode 100644 index 0000000..f145c5d --- /dev/null +++ b/core/modules/block/services.yml @@ -0,0 +1,12 @@ + +services: + plugin.manager.block: + class: Drupal\block\Plugin\Type\BlockManager + arguments: ['%container.namespaces%'] + cache.block: + class: Drupal\Core\Cache\CacheBackendInterface + tags: + - { name: cache.bin } + factory_method: get + factory_service: cache_factory + arguments: [block] diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/CkeditorBundle.php b/core/modules/ckeditor/lib/Drupal/ckeditor/CkeditorBundle.php deleted file mode 100644 index 151c23a..0000000 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/CkeditorBundle.php +++ /dev/null @@ -1,27 +0,0 @@ -register('plugin.manager.ckeditor.plugin', 'Drupal\ckeditor\CKEditorPluginManager') - ->addArgument('%container.namespaces%'); - } - -} diff --git a/core/modules/ckeditor/services.yml b/core/modules/ckeditor/services.yml new file mode 100644 index 0000000..79b69fc --- /dev/null +++ b/core/modules/ckeditor/services.yml @@ -0,0 +1,5 @@ + +services: + plugin.manager.ckeditor.plugin: + class: Drupal\ckeditor\CKEditorPluginManager + arguments: ['%container.namespaces%'] diff --git a/core/modules/edit/lib/Drupal/edit/EditBundle.php b/core/modules/edit/lib/Drupal/edit/EditBundle.php deleted file mode 100644 index fe52594..0000000 --- a/core/modules/edit/lib/Drupal/edit/EditBundle.php +++ /dev/null @@ -1,38 +0,0 @@ -register('plugin.manager.edit.editor', 'Drupal\edit\Plugin\EditorManager') - ->addArgument('%container.namespaces%'); - - $container->register('access_check.edit.entity_field', 'Drupal\edit\Access\EditEntityFieldAccessCheck') - ->addTag('access_check'); - - $container->register('edit.editor.selector', 'Drupal\edit\EditorSelector') - ->addArgument(new Reference('plugin.manager.edit.editor')); - - $container->register('edit.metadata.generator', 'Drupal\edit\MetadataGenerator') - ->addArgument(new Reference('access_check.edit.entity_field')) - ->addArgument(new Reference('edit.editor.selector')) - ->addArgument(new Reference('plugin.manager.edit.editor')); - } - -} diff --git a/core/modules/edit/services.yml b/core/modules/edit/services.yml new file mode 100644 index 0000000..aaf8959 --- /dev/null +++ b/core/modules/edit/services.yml @@ -0,0 +1,15 @@ + +services: + plugin.manager.edit.editor: + class: Drupal\edit\Plugin\EditorManager + arguments: ['%container.namespaces%'] + access_check.edit.entity_field: + class: Drupal\edit\Access\EditEntityFieldAccessCheck + tags: + - { name: access_check } + edit.editor.selector: + class: Drupal\edit\EditorSelector + arguments: ['@plugin.manager.edit.editor'] + edit.metadata.generator: + class: Drupal\edit\MetadataGenerator + arguments: ['@access_check.edit.entity_field', '@edit.editor.selector', '@plugin.manager.edit.editor'] diff --git a/core/modules/editor/lib/Drupal/editor/EditorBundle.php b/core/modules/editor/lib/Drupal/editor/EditorBundle.php deleted file mode 100644 index 0338998..0000000 --- a/core/modules/editor/lib/Drupal/editor/EditorBundle.php +++ /dev/null @@ -1,28 +0,0 @@ -register('plugin.manager.editor', 'Drupal\editor\Plugin\EditorManager') - ->addArgument('%container.namespaces%'); - } - -} diff --git a/core/modules/editor/services.yml b/core/modules/editor/services.yml new file mode 100644 index 0000000..5e8bf45 --- /dev/null +++ b/core/modules/editor/services.yml @@ -0,0 +1,5 @@ + +services: + plugin.manager.editor: + class: Drupal\editor\Plugin\EditorManager + arguments: ['%container.namespaces%'] diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceBundle.php b/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceBundle.php deleted file mode 100644 index f9762b6..0000000 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceBundle.php +++ /dev/null @@ -1,30 +0,0 @@ -register('plugin.manager.entity_reference.selection', 'Drupal\entity_reference\Plugin\Type\SelectionPluginManager') - ->addArgument('%container.namespaces%'); - $container->register('entity_reference.autocomplete', 'Drupal\entity_reference\EntityReferenceAutocomplete') - ->addArgument(new Reference('plugin.manager.entity')); - } -} diff --git a/core/modules/entity_reference/services.yml b/core/modules/entity_reference/services.yml new file mode 100644 index 0000000..084e422 --- /dev/null +++ b/core/modules/entity_reference/services.yml @@ -0,0 +1,8 @@ + +services: + plugin.manager.entity_reference.selection: + class: Drupal\entity_reference\Plugin\Type\SelectionPluginManager + arguments: ['%container.namespaces%'] + entity_reference.autocomplete: + class: Drupal\entity_reference\EntityReferenceAutocomplete + arguments: ['@plugin.manager.entity'] diff --git a/core/modules/field/lib/Drupal/field/FieldBundle.php b/core/modules/field/lib/Drupal/field/FieldBundle.php deleted file mode 100644 index 9ca3ff9..0000000 --- a/core/modules/field/lib/Drupal/field/FieldBundle.php +++ /dev/null @@ -1,31 +0,0 @@ -register('plugin.manager.field.widget', 'Drupal\field\Plugin\Type\Widget\WidgetPluginManager') - ->addArgument('%container.namespaces%'); - $container->register('plugin.manager.field.formatter', 'Drupal\field\Plugin\Type\Formatter\FormatterPluginManager') - ->addArgument('%container.namespaces%'); - CacheFactory::registerBin($container, 'field'); - } - -} diff --git a/core/modules/field/services.yml b/core/modules/field/services.yml new file mode 100644 index 0000000..e8e5cfa --- /dev/null +++ b/core/modules/field/services.yml @@ -0,0 +1,15 @@ + +services: + plugin.manager.field.widget: + class: Drupal\field\Plugin\Type\Widget\WidgetPluginManager + arguments: ['%container.namespaces%'] + plugin.manager.field.formatter: + class: Drupal\field\Plugin\Type\Formatter\FormatterPluginManager + arguments: ['%container.namespaces%'] + cache.field: + class: Drupal\Core\Cache\CacheBackendInterface + tags: + - { name: cache.bin } + factory_method: get + factory_service: cache_factory + arguments: [field] diff --git a/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/FieldSqlStorageBundle.php b/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/FieldSqlStorageBundle.php deleted file mode 100644 index 2d5f996..0000000 --- a/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/FieldSqlStorageBundle.php +++ /dev/null @@ -1,22 +0,0 @@ -register('entity.query.field_sql_storage', 'Drupal\field_sql_storage\Entity\QueryFactory') - ->addArgument(new Reference('database')); - } - -} diff --git a/core/modules/field_sql_storage/services.yml b/core/modules/field_sql_storage/services.yml new file mode 100644 index 0000000..4064337 --- /dev/null +++ b/core/modules/field_sql_storage/services.yml @@ -0,0 +1,5 @@ + +services: + entity.query.field_sql_storage: + class: Drupal\field_sql_storage\Entity\QueryFactory + arguments: ['@database'] diff --git a/core/modules/file/lib/Drupal/file/FileBundle.php b/core/modules/file/lib/Drupal/file/FileBundle.php deleted file mode 100644 index 79618ad..0000000 --- a/core/modules/file/lib/Drupal/file/FileBundle.php +++ /dev/null @@ -1,19 +0,0 @@ -register('file.usage', 'Drupal\file\FileUsage\DatabaseFileUsageBackend') - ->addArgument(new Reference('database')); - } -} diff --git a/core/modules/file/services.yml b/core/modules/file/services.yml new file mode 100644 index 0000000..66ca272 --- /dev/null +++ b/core/modules/file/services.yml @@ -0,0 +1,5 @@ + +services: + file.usage: + class: Drupal\file\FileUsage\DatabaseFileUsageBackend + arguments: ['@database'] diff --git a/core/modules/filter/lib/Drupal/filter/FilterBundle.php b/core/modules/filter/lib/Drupal/filter/FilterBundle.php deleted file mode 100644 index 2c0a460..0000000 --- a/core/modules/filter/lib/Drupal/filter/FilterBundle.php +++ /dev/null @@ -1,26 +0,0 @@ -register('serializer.normalizer.entity_reference_item.hal', 'Drupal\hal\Normalizer\EntityReferenceItemNormalizer') - ->addMethodCall('setLinkManager', array(new Reference('rest.link_manager'))) - ->addTag('normalizer', array('priority' => $priority)); - $container->register('serializer.normalizer.field_item.hal', 'Drupal\hal\Normalizer\FieldItemNormalizer') - ->addMethodCall('setLinkManager', array(new Reference('rest.link_manager'))) - ->addTag('normalizer', array('priority' => $priority)); - $container->register('serializer.normalizer.field.hal', 'Drupal\hal\Normalizer\FieldNormalizer') - ->addMethodCall('setLinkManager', array(new Reference('rest.link_manager'))) - ->addTag('normalizer', array('priority' => $priority)); - $container->register('serializer.normalizer.entity.hal', 'Drupal\hal\Normalizer\EntityNormalizer') - ->addMethodCall('setLinkManager', array(new Reference('rest.link_manager'))) - ->addTag('normalizer', array('priority' => $priority)); - - $container->register('serializer.encoder.hal', 'Drupal\hal\Encoder\JsonEncoder') - ->addTag('encoder', array( - 'priority' => $priority, - 'format' => array( - 'hal_json' => 'HAL (JSON)', - ), - )); - - $container->register('hal.subscriber', 'Drupal\hal\HalSubscriber') - ->addTag('event_subscriber'); - } -} diff --git a/core/modules/hal/services.yml b/core/modules/hal/services.yml new file mode 100644 index 0000000..cbb921b --- /dev/null +++ b/core/modules/hal/services.yml @@ -0,0 +1,38 @@ + +services: + serializer.normalizer.entity_reference_item.hal: + class: Drupal\hal\Normalizer\EntityReferenceItemNormalizer + tags: + - { name: normalizer, priority: 10 } + calls: + - [setLinkManager, ['@rest.link_manager']] + + serializer.normalizer.field_item.hal: + class: Drupal\hal\Normalizer\FieldItemNormalizer + tags: + - { name: normalizer, priority: 10 } + calls: + - [setLinkManager, ['@rest.link_manager']] + + serializer.normalizer.field.hal: + class: Drupal\hal\Normalizer\FieldNormalizer + tags: + - { name: normalizer, priority: 10 } + calls: + - [setLinkManager, ['@rest.link_manager']] + + serializer.normalizer.entity.hal: + class: Drupal\hal\Normalizer\EntityNormalizer + tags: + - { name: normalizer, priority: 10 } + calls: + - [setLinkManager, ['@rest.link_manager']] + + serializer.encoder.hal: + class: Drupal\hal\Encoder\JsonEncoder + tags: + - { name: encoder, priority: 10 format: { hal_json: 'HAL (JSON)' } } + hal.subscriber: + class: Drupal\hal\HalSubscriber + tags: + - { name: event_subscriber } diff --git a/core/modules/jsonld/lib/Drupal/jsonld/JsonldBundle.php b/core/modules/jsonld/lib/Drupal/jsonld/JsonldBundle.php deleted file mode 100644 index 3024883..0000000 --- a/core/modules/jsonld/lib/Drupal/jsonld/JsonldBundle.php +++ /dev/null @@ -1,72 +0,0 @@ - array( - 'jsonld' => 'Drupal\jsonld\JsonldEntityReferenceNormalizer', - ), - 'field_item' => array( - 'jsonld' => 'Drupal\jsonld\JsonldFieldItemNormalizer', - ), - // Entity. - 'entity' => array( - 'jsonld' => 'Drupal\jsonld\JsonldEntityNormalizer', - ), - // RDF Schema. - 'rdf_schema' => array( - 'jsonld' => 'Drupal\jsonld\JsonldRdfSchemaNormalizer', - ), - ); - - // Add Normalizers to service container. - foreach ($normalizers as $supported_class => $formats) { - foreach ($formats as $format => $normalizer_class) { - $container->register("serializer.normalizer.{$supported_class}.{$format}", $normalizer_class) - ->addArgument(new Reference('rdf.site_schema_manager')) - ->addArgument(new Reference('rdf.mapping_manager')) - ->addTag('normalizer', array('priority' => $priority)); - } - } - - // Add the encoder to the service container. Encoders can only specify which - // format they support in Encoder::supportsEncoding(). - $container->register('serializer.encoder.jsonld', 'Drupal\jsonld\JsonldEncoder') - ->addTag('encoder', array( - 'priority' => $priority, - 'format' => array( - 'jsonld' => 'JSON-LD', - 'drupal_jsonld' => 'Drupal JSON-LD', - ), - )); - - $container->register('jsonld.subscriber', 'Drupal\jsonld\EventSubscriber\JsonldSubscriber') - ->addTag('event_subscriber'); - } -} diff --git a/core/modules/jsonld/services.yml b/core/modules/jsonld/services.yml new file mode 100644 index 0000000..8137db4 --- /dev/null +++ b/core/modules/jsonld/services.yml @@ -0,0 +1,35 @@ +# Normalizers can be specified to support a particular class and format in +# Normalizer::supportsNormalization(). Since the first matching Normalizer +# is used, Normalizers should be ordered from most specific to least +# specific. +services: + serializer.normalizer.entity_reference.jsonld: + class: Drupal\jsonld\JsonldEntityReferenceNormalizer + tags: + - { name: normalizer, priority: 5 } + arguments: ['@rdf.site_schema_manager', '@rdf.mapping_manager'] + serializer.normalizer.field_item.jsonld: + class: Drupal\jsonld\JsonldFieldItemNormalizer + tags: + - { name: normalizer, priority: 5 } + arguments: ['@rdf.site_schema_manager', '@rdf.mapping_manager'] + serializer.normalizer.entity.jsonld: + class: Drupal\jsonld\JsonldEntityNormalizer + tags: + - { name: normalizer, priority: 5 } + arguments: ['@rdf.site_schema_manager', '@rdf.mapping_manager'] + serializer.normalizer.rdf_schema.jsonld: + class: Drupal\jsonld\JsonldRdfSchemaNormalizer + tags: + - { name: normalizer, priority: 5 } + arguments: ['@rdf.site_schema_manager', '@rdf.mapping_manager'] +# Add the encoder to the service container. Encoders can only specify which +# format they support in Encoder::supportsEncoding(). + serializer.encoder.jsonld: + class: Drupal\jsonld\JsonldEncoder + tags: + - { name: encoder, priority: 5 format: { jsonld: JSON-LD, drupal_jsonld: 'Drupal JSON-LD' } } + jsonld.subscriber: + class: Drupal\jsonld\EventSubscriber\JsonldSubscriber + tags: + - { name: event_subscriber } diff --git a/core/modules/language/lib/Drupal/language/LanguageBundle.php b/core/modules/language/lib/Drupal/language/LanguageBundle.php deleted file mode 100644 index 1e788aa..0000000 --- a/core/modules/language/lib/Drupal/language/LanguageBundle.php +++ /dev/null @@ -1,29 +0,0 @@ -register('path_processor_language', 'Drupal\language\HttpKernel\PathProcessorLanguage') - ->addArgument(new Reference('module_handler')) - ->addTag('path_processor_inbound', array('priority' => 300)); - } - -} diff --git a/core/modules/language/services.yml b/core/modules/language/services.yml new file mode 100644 index 0000000..005c59a --- /dev/null +++ b/core/modules/language/services.yml @@ -0,0 +1,7 @@ + +services: + path_processor_language: + class: Drupal\language\HttpKernel\PathProcessorLanguage + tags: + - { name: path_processor_inbound, priority: 300 } + arguments: ['@module_handler'] diff --git a/core/modules/layout/lib/Drupal/layout/LayoutBundle.php b/core/modules/layout/lib/Drupal/layout/LayoutBundle.php deleted file mode 100644 index c639da9..0000000 --- a/core/modules/layout/lib/Drupal/layout/LayoutBundle.php +++ /dev/null @@ -1,26 +0,0 @@ -register('plugin.manager.layout', 'Drupal\layout\Plugin\Type\LayoutManager') - ->addArgument('%container.namespaces%'); - } -} diff --git a/core/modules/layout/services.yml b/core/modules/layout/services.yml new file mode 100644 index 0000000..9b540ee --- /dev/null +++ b/core/modules/layout/services.yml @@ -0,0 +1,5 @@ + +services: + plugin.manager.layout: + class: Drupal\layout\Plugin\Type\LayoutManager + arguments: ['%container.namespaces%'] diff --git a/core/modules/locale/lib/Drupal/locale/LocaleBundle.php b/core/modules/locale/lib/Drupal/locale/LocaleBundle.php deleted file mode 100644 index 7c2ca6e..0000000 --- a/core/modules/locale/lib/Drupal/locale/LocaleBundle.php +++ /dev/null @@ -1,29 +0,0 @@ -register('locale_config_subscriber', 'Drupal\locale\LocaleConfigSubscriber') - ->addArgument(new Reference('language_manager')) - ->addArgument(new Reference('config.context')) - ->addTag('event_subscriber'); - } - -} diff --git a/core/modules/locale/services.yml b/core/modules/locale/services.yml new file mode 100644 index 0000000..0711d1d --- /dev/null +++ b/core/modules/locale/services.yml @@ -0,0 +1,7 @@ + +services: + locale_config_subscriber: + class: Drupal\locale\LocaleConfigSubscriber + tags: + - { name: event_subscriber } + arguments: ['@language_manager', '@config.context'] diff --git a/core/modules/rdf/lib/Drupal/rdf/RdfBundle.php b/core/modules/rdf/lib/Drupal/rdf/RdfBundle.php deleted file mode 100644 index 2d3aa76..0000000 --- a/core/modules/rdf/lib/Drupal/rdf/RdfBundle.php +++ /dev/null @@ -1,39 +0,0 @@ -register('rdf.site_schema_manager', 'Drupal\rdf\SiteSchema\SiteSchemaManager') - ->addArgument(new Reference('cache.cache')); - // Mapping manager service. - $container->register('rdf.mapping_manager', 'Drupal\rdf\RdfMappingManager') - ->addArgument(new Reference('event_dispatcher')) - ->addArgument(new Reference('rdf.site_schema_manager')); - - // Mapping subscriber. - $container->register('rdf.mapping', 'Drupal\rdf\EventSubscriber\MappingSubscriber') - ->addTag('event_subscriber'); - // Route subscriber. - $container->register('rdf.route_subscriber', 'Drupal\rdf\EventSubscriber\RouteSubscriber') - ->addArgument(new Reference('rdf.site_schema_manager')) - ->addTag('event_subscriber'); - } -} diff --git a/core/modules/rdf/services.yml b/core/modules/rdf/services.yml new file mode 100644 index 0000000..f95e944 --- /dev/null +++ b/core/modules/rdf/services.yml @@ -0,0 +1,17 @@ + +services: + rdf.site_schema_manager: + class: Drupal\rdf\SiteSchema\SiteSchemaManager + arguments: ['@cache.cache'] + rdf.mapping_manager: + class: Drupal\rdf\RdfMappingManager + arguments: ['@event_dispatcher', '@rdf.site_schema_manager'] + rdf.mapping: + class: Drupal\rdf\EventSubscriber\MappingSubscriber + tags: + - { name: event_subscriber } + rdf.route_subscriber: + class: Drupal\rdf\EventSubscriber\RouteSubscriber + tags: + - { name: event_subscriber } + arguments: ['@rdf.site_schema_manager'] diff --git a/core/modules/rdf/tests/rdf_test_mapping/lib/Drupal/rdf_test_mapping/RdfTestMappingBundle.php b/core/modules/rdf/tests/rdf_test_mapping/lib/Drupal/rdf_test_mapping/RdfTestMappingBundle.php deleted file mode 100644 index 3de3980..0000000 --- a/core/modules/rdf/tests/rdf_test_mapping/lib/Drupal/rdf_test_mapping/RdfTestMappingBundle.php +++ /dev/null @@ -1,27 +0,0 @@ -register('rdf_test_mapping.mapping', 'Drupal\rdf_test_mapping\EventSubscriber\TestMappingSubscriber') - ->addTag('event_subscriber'); - } - -} diff --git a/core/modules/rdf/tests/rdf_test_mapping/services.yml b/core/modules/rdf/tests/rdf_test_mapping/services.yml new file mode 100644 index 0000000..a35b987 --- /dev/null +++ b/core/modules/rdf/tests/rdf_test_mapping/services.yml @@ -0,0 +1,6 @@ + +services: + rdf_test_mapping.mapping: + class: Drupal\rdf_test_mapping\EventSubscriber\TestMappingSubscriber + tags: + - { name: event_subscriber } diff --git a/core/modules/rest/lib/Drupal/rest/RestBundle.php b/core/modules/rest/lib/Drupal/rest/RestBundle.php deleted file mode 100644 index 1c98b79..0000000 --- a/core/modules/rest/lib/Drupal/rest/RestBundle.php +++ /dev/null @@ -1,43 +0,0 @@ -register('plugin.manager.rest', 'Drupal\rest\Plugin\Type\ResourcePluginManager') - ->addArgument('%container.namespaces%'); - - $container->register('rest.route_subscriber', 'Drupal\rest\EventSubscriber\RouteSubscriber') - ->addArgument(new Reference('plugin.manager.rest')) - ->addArgument(new Reference('config.factory')) - ->addTag('event_subscriber'); - - $container->register('access_check.rest.csrf', 'Drupal\rest\Access\CSRFAccessCheck') - ->addTag('access_check'); - - $container->register('rest.link_manager', 'Drupal\rest\LinkManager\LinkManager') - ->addArgument(new Reference('rest.link_manager.type')) - ->addArgument(new Reference('rest.link_manager.relation')); - $container->register('rest.link_manager.type', 'Drupal\rest\LinkManager\TypeLinkManager') - ->addArgument(new Reference('cache.cache')); - $container->register('rest.link_manager.relation', 'Drupal\rest\LinkManager\RelationLinkManager'); - } -} diff --git a/core/modules/rest/services.yml b/core/modules/rest/services.yml new file mode 100644 index 0000000..3e1461a --- /dev/null +++ b/core/modules/rest/services.yml @@ -0,0 +1,22 @@ + +services: + plugin.manager.rest: + class: Drupal\rest\Plugin\Type\ResourcePluginManager + arguments: ['%container.namespaces%'] + rest.route_subscriber: + class: Drupal\rest\EventSubscriber\RouteSubscriber + tags: + - { name: event_subscriber } + arguments: ['@plugin.manager.rest', '@config.factory'] + access_check.rest.csrf: + class: Drupal\rest\Access\CSRFAccessCheck + tags: + - { name: access_check } + rest.link_manager: + class: Drupal\rest\LinkManager\LinkManager + arguments: ['@rest.link_manager.type', '@rest.link_manager.relation'] + rest.link_manager.type: + class: Drupal\rest\LinkManager\TypeLinkManager + arguments: ['@cache.cache'] + rest.link_manager.relation: + class: Drupal\rest\LinkManager\RelationLinkManager diff --git a/core/modules/serialization/lib/Drupal/serialization/SerializationBundle.php b/core/modules/serialization/lib/Drupal/serialization/SerializationBundle.php index a2744b5..bb0d386 100644 --- a/core/modules/serialization/lib/Drupal/serialization/SerializationBundle.php +++ b/core/modules/serialization/lib/Drupal/serialization/SerializationBundle.php @@ -19,20 +19,6 @@ class SerializationBundle extends Bundle { * Overrides \Symfony\Component\HttpKernel\Bundle\Bundle::build(). */ public function build(ContainerBuilder $container) { - // Add Serializer with arguments to be replaced in the compiler pass. - $container->register('serializer', 'Symfony\Component\Serializer\Serializer') - ->addArgument(array()) - ->addArgument(array()); - - $container->register('serializer.normalizer.complex_data', 'Drupal\serialization\Normalizer\ComplexDataNormalizer')->addTag('normalizer'); - $container->register('serializer.normalizer.list', 'Drupal\serialization\Normalizer\ListNormalizer')->addTag('normalizer'); - $container->register('serializer.normalizer.typed_data', 'Drupal\serialization\Normalizer\TypedDataNormalizer')->addTag('normalizer'); - - $container->register('serializer.encoder.json', 'Drupal\serialization\Encoder\JsonEncoder') - ->addTag('encoder', array('format' => array('json' => 'JSON'))); - $container->register('serializer.encoder.xml', 'Drupal\serialization\Encoder\XmlEncoder') - ->addTag('encoder', array('format' => array('xml' => 'XML'))); - // Add a compiler pass for adding Normalizers and Encoders to Serializer. $container->addCompilerPass(new RegisterSerializationClassesCompilerPass()); } diff --git a/core/modules/serialization/services.yml b/core/modules/serialization/services.yml new file mode 100644 index 0000000..101c629 --- /dev/null +++ b/core/modules/serialization/services.yml @@ -0,0 +1,25 @@ + +services: + serializer: + class: Symfony\Component\Serializer\Serializer + arguments: [{ }, { }] + serializer.normalizer.complex_data: + class: Drupal\serialization\Normalizer\ComplexDataNormalizer + tags: + - { name: normalizer } + serializer.normalizer.list: + class: Drupal\serialization\Normalizer\ListNormalizer + tags: + - { name: normalizer } + serializer.normalizer.typed_data: + class: Drupal\serialization\Normalizer\TypedDataNormalizer + tags: + - { name: normalizer } + serializer.encoder.json: + class: Drupal\serialization\Encoder\JsonEncoder + tags: + - { name: encoder, format: { json: JSON } } + serializer.encoder.xml: + class: Drupal\serialization\Encoder\XmlEncoder + tags: + - { name: encoder, format: { xml: XML } } diff --git a/core/modules/serialization/tests/serialization_test/lib/Drupal/serialization_test/SerializationTestBundle.php b/core/modules/serialization/tests/serialization_test/lib/Drupal/serialization_test/SerializationTestBundle.php deleted file mode 100644 index ab9f0f1..0000000 --- a/core/modules/serialization/tests/serialization_test/lib/Drupal/serialization_test/SerializationTestBundle.php +++ /dev/null @@ -1,26 +0,0 @@ -register('serializer.normalizer.serialization_test', 'Drupal\serialization_test\SerializationTestNormalizer')->addTag('normalizer'); - $container->register('serializer.encoder.serialization_test', 'Drupal\serialization_test\SerializationTestEncoder') - ->addTag('encoder', array('format' => array('serialization_test' => 'Serialization test'))); - } -} diff --git a/core/modules/serialization/tests/serialization_test/services.yml b/core/modules/serialization/tests/serialization_test/services.yml new file mode 100644 index 0000000..9171a57 --- /dev/null +++ b/core/modules/serialization/tests/serialization_test/services.yml @@ -0,0 +1,10 @@ + +services: + serializer.normalizer.serialization_test: + class: Drupal\serialization_test\SerializationTestNormalizer + tags: + - { name: normalizer } + serializer.encoder.serialization_test: + class: Drupal\serialization_test\SerializationTestEncoder + tags: + - { name: encoder, format: { serialization_test: 'Serialization test' } } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBundle.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBundle.php deleted file mode 100644 index 7e2fd2f..0000000 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBundle.php +++ /dev/null @@ -1,24 +0,0 @@ -containerBuild($container); - } - } - -} diff --git a/core/modules/system/lib/Drupal/system/SystemBundle.php b/core/modules/system/lib/Drupal/system/SystemBundle.php deleted file mode 100644 index 2b937c0..0000000 --- a/core/modules/system/lib/Drupal/system/SystemBundle.php +++ /dev/null @@ -1,30 +0,0 @@ -register('access_check.cron', 'Drupal\system\Access\CronAccessCheck') - ->addTag('access_check'); - - // Register the various system plugin manager classes with the dependency - // injection container. - $container->register('plugin.manager.system.plugin_ui', 'Drupal\system\Plugin\Type\PluginUIManager') - ->addArgument('%container.namespaces%'); - } -} diff --git a/core/modules/system/services.yml b/core/modules/system/services.yml new file mode 100644 index 0000000..9bfae4e --- /dev/null +++ b/core/modules/system/services.yml @@ -0,0 +1,9 @@ + +services: + access_check.cron: + class: Drupal\system\Access\CronAccessCheck + tags: + - { name: access_check } + plugin.manager.system.plugin_ui: + class: Drupal\system\Plugin\Type\PluginUIManager + arguments: ['%container.namespaces%'] diff --git a/core/modules/system/system.install b/core/modules/system/system.install index a93a124..abc1aac 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -2015,7 +2015,7 @@ function system_update_8046() { $module_list = drupal_container()->getParameter('container.modules'); drupal_load('module', 'views'); - drupal_container()->get('kernel')->updateModules(array_keys($module_list), array('views' => 'core/modules/views/views.module')); + drupal_container()->get('kernel')->updateModules($module_list, array('views' => 'core/modules/views/views.module')); // This does not fire a hook just calls views. config_install_default_config('module', 'views'); diff --git a/core/modules/system/tests/modules/bundle_test/lib/Drupal/bundle_test/BundleTestBundle.php b/core/modules/system/tests/modules/bundle_test/lib/Drupal/bundle_test/BundleTestBundle.php deleted file mode 100644 index 19b50e1..0000000 --- a/core/modules/system/tests/modules/bundle_test/lib/Drupal/bundle_test/BundleTestBundle.php +++ /dev/null @@ -1,29 +0,0 @@ -register('bundle_test_class', 'Drupal\bundle_test\TestClass') - ->addArgument(new Reference('state')) - ->addTag('event_subscriber') - ->addTag('needs_destruction'); - - // Override a default bundle used by core to a dummy class. - $container->register('file.usage', 'Drupal\bundle_test\TestFileUsage'); - } -} diff --git a/core/modules/system/tests/modules/bundle_test/services.yml b/core/modules/system/tests/modules/bundle_test/services.yml new file mode 100644 index 0000000..690d7dc --- /dev/null +++ b/core/modules/system/tests/modules/bundle_test/services.yml @@ -0,0 +1,10 @@ + +services: + bundle_test_class: + class: Drupal\bundle_test\TestClass + tags: + - { name: event_subscriber } + - { name: needs_destruction } + arguments: ['@state'] + file.usage: + class: Drupal\bundle_test\TestFileUsage diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestBundle.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestBundle.php deleted file mode 100644 index 0ccf9d8..0000000 --- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestBundle.php +++ /dev/null @@ -1,26 +0,0 @@ -register('form_test.form.serviceForm', 'Drupal\form_test\FormTestServiceObject'); - } - -} diff --git a/core/modules/system/tests/modules/form_test/services.yml b/core/modules/system/tests/modules/form_test/services.yml new file mode 100644 index 0000000..36fbe43 --- /dev/null +++ b/core/modules/system/tests/modules/form_test/services.yml @@ -0,0 +1,4 @@ + +services: + form_test.form.serviceform: + class: Drupal\form_test\FormTestServiceObject diff --git a/core/modules/system/tests/modules/session_test/lib/Drupal/session_test/SessionTestBundle.php b/core/modules/system/tests/modules/session_test/lib/Drupal/session_test/SessionTestBundle.php deleted file mode 100644 index b2a601e..0000000 --- a/core/modules/system/tests/modules/session_test/lib/Drupal/session_test/SessionTestBundle.php +++ /dev/null @@ -1,25 +0,0 @@ -register('session_test.subscriber', 'Drupal\session_test\EventSubscriber\SessionTestSubscriber') - ->addTag('event_subscriber'); - } -} diff --git a/core/modules/system/tests/modules/session_test/services.yml b/core/modules/system/tests/modules/session_test/services.yml new file mode 100644 index 0000000..3d52973 --- /dev/null +++ b/core/modules/system/tests/modules/session_test/services.yml @@ -0,0 +1,6 @@ + +services: + session_test.subscriber: + class: Drupal\session_test\EventSubscriber\SessionTestSubscriber + tags: + - { name: event_subscriber } diff --git a/core/modules/system/tests/modules/url_alter_test/lib/Drupal/url_alter_test/UrlAlterTestBundle.php b/core/modules/system/tests/modules/url_alter_test/lib/Drupal/url_alter_test/UrlAlterTestBundle.php deleted file mode 100644 index cd028e8..0000000 --- a/core/modules/system/tests/modules/url_alter_test/lib/Drupal/url_alter_test/UrlAlterTestBundle.php +++ /dev/null @@ -1,27 +0,0 @@ -register('url_alter_test.path_subscriber', 'Drupal\url_alter_test\PathSubscriber') - ->addTag('event_subscriber'); - } -} diff --git a/core/modules/system/tests/modules/url_alter_test/services.yml b/core/modules/system/tests/modules/url_alter_test/services.yml new file mode 100644 index 0000000..73e143b --- /dev/null +++ b/core/modules/system/tests/modules/url_alter_test/services.yml @@ -0,0 +1,6 @@ + +services: + url_alter_test.path_subscriber: + class: Drupal\url_alter_test\PathSubscriber + tags: + - { name: event_subscriber } diff --git a/core/modules/toolbar/lib/Drupal/toolbar/ToolbarBundle.php b/core/modules/toolbar/lib/Drupal/toolbar/ToolbarBundle.php deleted file mode 100644 index 30321ed..0000000 --- a/core/modules/toolbar/lib/Drupal/toolbar/ToolbarBundle.php +++ /dev/null @@ -1,26 +0,0 @@ -register('plugin.manager.tour.tip', 'Drupal\tour\TipPluginManager') - ->addArgument('%container.namespaces%'); - } - -} diff --git a/core/modules/tour/services.yml b/core/modules/tour/services.yml new file mode 100644 index 0000000..2e7eb71 --- /dev/null +++ b/core/modules/tour/services.yml @@ -0,0 +1,5 @@ + +services: + plugin.manager.tour.tip: + class: Drupal\tour\TipPluginManager + arguments: ['%container.namespaces%'] diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/TranslationEntityBundle.php b/core/modules/translation_entity/lib/Drupal/translation_entity/TranslationEntityBundle.php deleted file mode 100644 index f36e702..0000000 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/TranslationEntityBundle.php +++ /dev/null @@ -1,27 +0,0 @@ -register('translation_entity.synchronizer', 'Drupal\translation_entity\FieldTranslationSynchronizer') - ->addArgument(new Reference('plugin.manager.entity')); - } - -} diff --git a/core/modules/translation_entity/services.yml b/core/modules/translation_entity/services.yml new file mode 100644 index 0000000..72a77b7 --- /dev/null +++ b/core/modules/translation_entity/services.yml @@ -0,0 +1,5 @@ + +services: + translation_entity.synchronizer: + class: Drupal\translation_entity\FieldTranslationSynchronizer + arguments: ['@plugin.manager.entity'] diff --git a/core/modules/user/lib/Drupal/user/UserBundle.php b/core/modules/user/lib/Drupal/user/UserBundle.php deleted file mode 100644 index f7c4a88..0000000 --- a/core/modules/user/lib/Drupal/user/UserBundle.php +++ /dev/null @@ -1,34 +0,0 @@ -register('access_check.permission', 'Drupal\user\Access\PermissionAccessCheck') - ->addTag('access_check'); - $container->register('access_check.user.register', 'Drupal\user\Access\RegisterAccessCheck') - ->addTag('access_check'); - $container - ->register('user.data', 'Drupal\user\UserData') - ->addArgument(new Reference('database')); - $container->register('user.autocomplete', 'Drupal\user\UserAutocomplete') - ->addArgument(new Reference('database')) - ->addArgument(new Reference('config.factory')); - } -} diff --git a/core/modules/user/services.yml b/core/modules/user/services.yml new file mode 100644 index 0000000..b5d4951 --- /dev/null +++ b/core/modules/user/services.yml @@ -0,0 +1,16 @@ + +services: + access_check.permission: + class: Drupal\user\Access\PermissionAccessCheck + tags: + - { name: access_check } + access_check.user.register: + class: Drupal\user\Access\RegisterAccessCheck + tags: + - { name: access_check } + user.data: + class: Drupal\user\UserData + arguments: ['@database'] + user.autocomplete: + class: Drupal\user\UserAutocomplete + arguments: ['@database', '@config.factory'] diff --git a/core/modules/user/tests/modules/user_custom_phpass_params_test/lib/Drupal/user_custom_phpass_params_test/UserCustomPhpassParamsTestBundle.php b/core/modules/user/tests/modules/user_custom_phpass_params_test/lib/Drupal/user_custom_phpass_params_test/UserCustomPhpassParamsTestBundle.php deleted file mode 100644 index ab68d2e..0000000 --- a/core/modules/user/tests/modules/user_custom_phpass_params_test/lib/Drupal/user_custom_phpass_params_test/UserCustomPhpassParamsTestBundle.php +++ /dev/null @@ -1,20 +0,0 @@ -register('password', 'Drupal\Core\Password\PhpassHashedPassword') - ->addArgument(19); - } -} diff --git a/core/modules/user/tests/modules/user_custom_phpass_params_test/services.yml b/core/modules/user/tests/modules/user_custom_phpass_params_test/services.yml new file mode 100644 index 0000000..adc4793 --- /dev/null +++ b/core/modules/user/tests/modules/user_custom_phpass_params_test/services.yml @@ -0,0 +1,5 @@ + +services: + password: + class: Drupal\Core\Password\PhpassHashedPassword + arguments: [19] diff --git a/core/modules/views/lib/Drupal/views/ViewsBundle.php b/core/modules/views/lib/Drupal/views/ViewsBundle.php deleted file mode 100644 index 649fd7d..0000000 --- a/core/modules/views/lib/Drupal/views/ViewsBundle.php +++ /dev/null @@ -1,44 +0,0 @@ -register("plugin.manager.views.$type", 'Drupal\views\Plugin\ViewsPluginManager') - ->addArgument($type) - ->addArgument('%container.namespaces%'); - } - - $container->register('views.views_data', 'Drupal\views\ViewsDataCache') - ->addArgument(new Reference('cache.views_info')) - ->addArgument(new Reference('config.factory')) - ->addTag('needs_destruction'); - - $container->register('views.executable', 'Drupal\views\ViewExecutableFactory'); - - $container->register('views.analyzer', 'Drupal\views\Analyzer') - ->addArgument(new Reference('module_handler')); - CacheFactory::registerBin($container, 'views_info'); - CacheFactory::registerBin($container, 'views_results'); - } - -} diff --git a/core/modules/views/services.yml b/core/modules/views/services.yml new file mode 100644 index 0000000..a46edf8 --- /dev/null +++ b/core/modules/views/services.yml @@ -0,0 +1,83 @@ + +services: + plugin.manager.views.access: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [access, '%container.namespaces%'] + plugin.manager.views.area: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [area, '%container.namespaces%'] + plugin.manager.views.argument: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [argument, '%container.namespaces%'] + plugin.manager.views.argument_default: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [argument_default, '%container.namespaces%'] + plugin.manager.views.argument_validator: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [argument_validator, '%container.namespaces%'] + plugin.manager.views.cache: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [cache, '%container.namespaces%'] + plugin.manager.views.display_extender: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [display_extender, '%container.namespaces%'] + plugin.manager.views.display: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [display, '%container.namespaces%'] + plugin.manager.views.exposed_form: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [exposed_form, '%container.namespaces%'] + plugin.manager.views.field: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [field, '%container.namespaces%'] + plugin.manager.views.filter: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [filter, '%container.namespaces%'] + plugin.manager.views.join: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [join, '%container.namespaces%'] + plugin.manager.views.pager: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [pager, '%container.namespaces%'] + plugin.manager.views.query: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [query, '%container.namespaces%'] + plugin.manager.views.relationship: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [relationship, '%container.namespaces%'] + plugin.manager.views.row: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [row, '%container.namespaces%'] + plugin.manager.views.sort: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [sort, '%container.namespaces%'] + plugin.manager.views.style: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [style, '%container.namespaces%'] + plugin.manager.views.wizard: + class: Drupal\views\Plugin\ViewsPluginManager + arguments: [wizard, '%container.namespaces%'] + views.views_data: + class: Drupal\views\ViewsDataCache + tags: + - { name: needs_destruction } + arguments: ['@cache.views_info', '@config.factory'] + views.executable: + class: Drupal\views\ViewExecutableFactory + views.analyzer: + class: Drupal\views\Analyzer + arguments: ['@module_handler'] + cache.views_info: + class: Drupal\Core\Cache\CacheBackendInterface + tags: + - { name: cache.bin } + factory_method: get + factory_service: cache_factory + arguments: [views_info] + cache.views_results: + class: Drupal\Core\Cache\CacheBackendInterface + tags: + - { name: cache.bin } + factory_method: get + factory_service: cache_factory + arguments: [views_results] diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewsUiBundle.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewsUiBundle.php deleted file mode 100644 index 3d001a6..0000000 --- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewsUiBundle.php +++ /dev/null @@ -1,28 +0,0 @@ -register('paramconverter.views_ui', 'Drupal\views_ui\ParamConverter\ViewUIConverter') - ->addArgument(new Reference('user.tempstore')) - ->addTag('paramconverter'); - } - -} diff --git a/core/services.yml b/core/services.yml new file mode 100644 index 0000000..cea3a17 --- /dev/null +++ b/core/services.yml @@ -0,0 +1,377 @@ +services: + cache_factory: + class: Drupal\Core\Cache\CacheFactory + arguments: ['@settings'] + calls: + - [setContainer, ['@service_container']] + + cache.backend.database: + class: Drupal\Core\Cache\DatabaseBackendFactory + arguments: ['@database'] + cache.backend.memory: + class: Drupal\Core\Cache\MemoryBackendFactory + cache.bootstrap: + class: Drupal\Core\Cache\CacheBackendInterface + tags: + - { name: cache.bin } + factory_method: get + factory_service: cache_factory + arguments: [bootstrap] + cache.config: + class: Drupal\Core\Cache\CacheBackendInterface + tags: + - { name: cache.bin } + factory_method: get + factory_service: cache_factory + arguments: [config] + cache.cache: + class: Drupal\Core\Cache\CacheBackendInterface + tags: + - { name: cache.bin } + factory_method: get + factory_service: cache_factory + arguments: [cache] + cache.menu: + class: Drupal\Core\Cache\CacheBackendInterface + tags: + - { name: cache.bin } + factory_method: get + factory_service: cache_factory + arguments: [menu] + cache.page: + class: Drupal\Core\Cache\CacheBackendInterface + tags: + - { name: cache.bin } + factory_method: get + factory_service: cache_factory + arguments: [page] + cache.path: + class: Drupal\Core\Cache\CacheBackendInterface + tags: + - { name: cache.bin } + factory_method: get + factory_service: cache_factory + arguments: [path] + config.cachedstorage.storage: + class: Drupal\Core\Config\FileStorage + factory_class: Drupal\Core\Config\FileStorageFactory + factory_method: getActive + config.storage: + class: Drupal\Core\Config\CachedStorage + arguments: ['@config.cachedstorage.storage', '@cache.config'] + config.context.factory: + class: Drupal\Core\Config\Context\ConfigContextFactory + arguments: ['@event_dispatcher'] + config.context: + class: Drupal\Core\Config\Context\ContextInterface + tags: + - { name: persist } + factory_method: get + factory_service: config.context.factory + config.context.free: + class: Drupal\Core\Config\Context\ContextInterface + factory_method: get + factory_service: config.context.factory + arguments: [Drupal\Core\Config\Context\FreeConfigContext] + config.factory: + class: Drupal\Core\Config\ConfigFactory + tags: + - { name: persist } + arguments: ['@config.storage', '@config.context'] + config.storage.staging: + class: Drupal\Core\Config\FileStorage + factory_class: Drupal\Core\Config\FileStorageFactory + factory_method: getStaging + config.storage.snapshot: + class: Drupal\Core\Config\DatabaseStorage + arguments: ['@database', config_snapshot] + config.storage.schema: + class: Drupal\Core\Config\Schema\SchemaStorage + config.typed: + class: Drupal\Core\Config\TypedConfigManager + arguments: ['@config.storage', '@config.storage.schema'] + database: + class: Drupal\Core\Database\Connection + factory_class: Drupal\Core\Database\Database + factory_method: getConnection + arguments: [default] + keyvalue: + class: Drupal\Core\KeyValueStore\KeyValueFactory + arguments: ['@service_container'] + keyvalue.database: + class: Drupal\Core\KeyValueStore\KeyValueDatabaseFactory + arguments: ['@database'] + keyvalue.expirable: + class: Drupal\Core\KeyValueStore\KeyValueExpirableFactory + arguments: ['@service_container'] + keyvalue.expirable.database: + class: Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory + tags: + - { name: needs_destruction } + arguments: ['@database'] + settings: + class: Drupal\Component\Utility\Settings + factory_class: Drupal\Component\Utility\Settings + factory_method: getSingleton + state: + class: Drupal\Core\KeyValueStore\KeyValueStoreInterface + factory_method: get + factory_service: keyvalue + arguments: [state] + queue: + class: Drupal\Core\Queue\QueueFactory + arguments: ['@settings'] + calls: + - [setContainer, ['@service_container']] + + queue.database: + class: Drupal\Core\Queue\QueueDatabaseFactory + arguments: ['@database'] + path.alias_whitelist: + class: Drupal\Core\Path\AliasWhitelist + tags: + - { name: needs_destruction } + arguments: [path_alias_whitelist, cache, '@keyvalue', '@database'] + path.alias_manager: + class: Drupal\Core\Path\AliasManager + arguments: ['@database', '@path.alias_whitelist', '@language_manager'] + http_client_simpletest_subscriber: + class: Drupal\Core\Http\Plugin\SimpletestHttpRequestSubscriber + http_default_client: + class: Guzzle\Http\Client + arguments: [null, { curl.CURLOPT_TIMEOUT: 30, curl.CURLOPT_MAXREDIRS: 3 }] + calls: + - [addSubscriber, ['@http_client_simpletest_subscriber']] + - [setUserAgent, ['Drupal (+http://drupal.org/)']] + + plugin.manager.entity: + class: Drupal\Core\Entity\EntityManager + arguments: ['%container.namespaces%'] + request: + class: Symfony\Component\HttpFoundation\Request + event_dispatcher: + class: Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher + arguments: ['@service_container'] + controller_resolver: + class: Drupal\Core\ControllerResolver + arguments: ['@service_container'] + http_kernel: + class: Drupal\Core\HttpKernel + arguments: ['@event_dispatcher', '@service_container', '@controller_resolver'] + language_manager: + class: Drupal\Core\Language\LanguageManager + database.slave: + class: Drupal\Core\Database\Connection + factory_class: Drupal\Core\Database\Database + factory_method: getConnection + arguments: [slave] + typed_data: + class: Drupal\Core\TypedData\TypedDataManager + calls: + - [setValidationConstraintManager, ['@validation.constraint']] + + validation.constraint: + class: Drupal\Core\Validation\ConstraintManager + arguments: ['%container.namespaces%'] + lock: + class: Drupal\Core\Lock\DatabaseLockBackend + user.tempstore: + class: Drupal\user\TempStoreFactory + arguments: ['@database', '@lock'] + router.request_context: + class: Symfony\Component\Routing\RequestContext + calls: + - [fromRequest, ['@request']] + + router.route_provider: + class: Drupal\Core\Routing\RouteProvider + arguments: ['@database'] + router.matcher.final_matcher: + class: Drupal\Core\Routing\UrlMatcher + router.matcher: + class: Symfony\Cmf\Component\Routing\NestedMatcher\NestedMatcher + arguments: ['@router.route_provider'] + calls: + - [setFinalMatcher, ['@router.matcher.final_matcher']] + + router.generator: + class: Drupal\Core\Routing\UrlGenerator + arguments: ['@router.route_provider', '@path.alias_manager.cached'] + router.dynamic: + class: Symfony\Cmf\Component\Routing\DynamicRouter + arguments: ['@router.request_context', '@router.matcher', '@router.generator'] + legacy_generator: + class: Drupal\Core\Routing\NullGenerator + legacy_url_matcher: + class: Drupal\Core\LegacyUrlMatcher + legacy_router: + class: Symfony\Cmf\Component\Routing\DynamicRouter + arguments: ['@router.request_context', '@legacy_url_matcher', '@legacy_generator'] + router: + class: Symfony\Cmf\Component\Routing\ChainRouter + calls: + - [setContext, ['@router.request_context']] + - [add, ['@router.dynamic']] + - [add, ['@legacy_router']] + + entity.query: + class: Drupal\Core\Entity\Query\QueryFactory + arguments: ['@plugin.manager.entity'] + calls: + - [setContainer, ['@service_container']] + + entity.query.config: + class: Drupal\Core\Config\Entity\Query\QueryFactory + arguments: ['@config.storage'] + router.dumper: + class: Drupal\Core\Routing\MatcherDumper + arguments: ['@database'] + router.builder: + class: Drupal\Core\Routing\RouteBuilder + arguments: ['@router.dumper', '@lock', '@event_dispatcher', '@module_handler'] + path.alias_manager.cached: + class: Drupal\Core\CacheDecorator\AliasManagerCacheDecorator + arguments: ['@path.alias_manager', '@cache.path'] + path.crud: + class: Drupal\Core\Path\Path + arguments: ['@database', '@path.alias_manager'] + password: + class: Drupal\Core\Password\PhpassHashedPassword + arguments: [16] + mime_type_matcher: + class: Drupal\Core\Routing\MimeTypeMatcher + tags: + - { name: route_filter } + paramconverter_manager: + class: Drupal\Core\ParamConverter\ParamConverterManager + tags: + - { name: route_enhancer } + paramconverter.entity: + class: Drupal\Core\ParamConverter\EntityConverter + tags: + - { name: paramconverter } + arguments: ['@plugin.manager.entity'] + router_processor_subscriber: + class: Drupal\Core\EventSubscriber\RouteProcessorSubscriber + tags: + - { name: event_subscriber } + arguments: ['@content_negotiation'] + router_listener: + class: Symfony\Component\HttpKernel\EventListener\RouterListener + tags: + - { name: event_subscriber } + arguments: ['@router'] + content_negotiation: + class: Drupal\Core\ContentNegotiation + view_subscriber: + class: Drupal\Core\EventSubscriber\ViewSubscriber + tags: + - { name: event_subscriber } + arguments: ['@content_negotiation'] + legacy_access_subscriber: + class: Drupal\Core\EventSubscriber\LegacyAccessSubscriber + tags: + - { name: event_subscriber } + access_manager: + class: Drupal\Core\Access\AccessManager + calls: + - [setContainer, ['@service_container']] + + access_subscriber: + class: Drupal\Core\EventSubscriber\AccessSubscriber + tags: + - { name: event_subscriber } + arguments: ['@access_manager'] + access_check.default: + class: Drupal\Core\Access\DefaultAccessCheck + tags: + - { name: access_check } + maintenance_mode_subscriber: + class: Drupal\Core\EventSubscriber\MaintenanceModeSubscriber + tags: + - { name: event_subscriber } + path_subscriber: + class: Drupal\Core\EventSubscriber\PathSubscriber + tags: + - { name: event_subscriber } + arguments: ['@path.alias_manager.cached', '@path_processor_manager'] + legacy_request_subscriber: + class: Drupal\Core\EventSubscriber\LegacyRequestSubscriber + tags: + - { name: event_subscriber } + legacy_controller_subscriber: + class: Drupal\Core\EventSubscriber\LegacyControllerSubscriber + tags: + - { name: event_subscriber } + finish_response_subscriber: + class: Drupal\Core\EventSubscriber\FinishResponseSubscriber + tags: + - { name: event_subscriber } + arguments: ['@language_manager'] + scope: request + request_close_subscriber: + class: Drupal\Core\EventSubscriber\RequestCloseSubscriber + tags: + - { name: event_subscriber } + arguments: ['@module_handler'] + config_global_override_subscriber: + class: Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber + tags: + - { name: event_subscriber } + language_request_subscriber: + class: Drupal\Core\EventSubscriber\LanguageRequestSubscriber + tags: + - { name: event_subscriber } + arguments: ['@language_manager'] + exception_controller: + class: Drupal\Core\ExceptionController + arguments: ['@content_negotiation'] + calls: + - [setContainer, ['@service_container']] + + exception_listener: + class: Symfony\Component\HttpKernel\EventListener\ExceptionListener + tags: + - { name: event_subscriber } + arguments: [['@exception_controller', execute]] + path_processor_manager: + class: Drupal\Core\PathProcessor\PathProcessorManager + path_processor_decode: + class: Drupal\Core\PathProcessor\PathProcessorDecode + tags: + - { name: path_processor_inbound, priority: 1000 } + path_processor_front: + class: Drupal\Core\PathProcessor\PathProcessorFront + tags: + - { name: path_processor_inbound, priority: 200 } + arguments: ['@config.factory'] + path_processor_alias: + class: Drupal\Core\PathProcessor\PathProcessorAlias + tags: + - { name: path_processor_inbound, priority: 100 } + arguments: ['@path.alias_manager'] + transliteration: + class: Drupal\Core\Transliteration\PHPTransliteration + flood: + class: Drupal\Core\Flood\DatabaseBackend + arguments: ['@database'] + plugin.manager.condition: + class: Drupal\Core\Condition\ConditionManager + kernel_destruct_subscriber: + class: Drupal\Core\EventSubscriber\KernelDestructionSubscriber + tags: + - { name: event_subscriber } + calls: + - [setContainer, ['@service_container']] + + ajax.subscriber: + class: Drupal\Core\Ajax\AjaxSubscriber + tags: + - { name: event_subscriber } + image.toolkit.manager: + class: Drupal\system\Plugin\ImageToolkitManager + arguments: ['%container.namespaces%'] + image.toolkit: + class: Drupal\system\Plugin\ImageToolkitInterface + factory_method: getDefaultToolkit + factory_service: image.toolkit.manager