The following classes now require the datetime.time service (\Drupal\Component\Datetime\TimeInterface $time) as a constructor parameter.
These changes are needed to replace calls to the deprecated REQUEST_TIME global constant. (https://www.drupal.org/node/2785211)
- \Drupal\Core\Asset\JsCollectionRenderer
- \Drupal\Core\Cache\ApcuBackend
- \Drupal\Core\Cache\ApcuBackendFactory
- \Drupal\Core\Cache\DatabaseBackend
- \Drupal\Core\Cache\DatabaseBackendFactory
- \Drupal\Core\Cache\MemoryBackend
- \Drupal\Core\Cache\MemoryBackendFactory
- \Drupal\Core\Cache\MemoryCounterBackendFactory
- \Drupal\Core\Cache\PhpBackend
- \Drupal\Core\Cache\PhpBackendFactory
- \Drupal\Core\EventSubscriber\FinishResponseSubscriber
- \Drupal\Core\Flood\DatabaseBackend
- \Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory
- \Drupal\Core\KeyValueStore\DatabaseStorageExpirable
- \Drupal\Core\Session\SessionHandler
- \Drupal\Core\Session\SessionManager
- \Drupal\comment\CommentStatistics
- \Drupal\path_alias\AliasManager
- \Drupal\search\SearchIndex
- \Drupal\update\UpdateProcessor
- \Drupal\user\EventSubscriber\UserRequestSubscriber
For all of the above constructors the protected TimeInterface $time parameter is added as the last of the constructor parameters.
Exception to the parameter order, due to optional parameters, are:
- \Drupal\Core\Cache\DatabaseBackend
- \Drupal\Core\EventSubscriber\FinishResponseSubscriber
- \Drupal\Core\Cache\DatabaseBackendFactory
- \Drupal\Core\KeyValueStore\DatabaseStorageExpirable
- \Drupal\Core\Session\SessionManager
- \Drupal\comment\CommentStatistics
Before:
public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, $bin, $max_rows = NULL)
After:
public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, $bin, protected TimeInterface $time, $max_rows = NULL)
Before:
public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, Settings $settings = NULL)
After:
public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, protected TimeInterface $time, Settings $settings = NULL)
Before:
public function __construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, RequestPolicyInterface $request_policy, ResponsePolicyInterface $response_policy, CacheContextsManager $cache_contexts_manager, $http_response_debug_cacheability_headers = FALSE)
After:
public function __construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, RequestPolicyInterface $request_policy, ResponsePolicyInterface $response_policy, CacheContextsManager $cache_contexts_manager, protected TimeInterface $time, $http_response_debug_cacheability_headers = FALSE)
Before:
public function __construct($collection, SerializationInterface $serializer, Connection $connection, $table = 'key_value_expire')
After:
public function __construct($collection, SerializationInterface $serializer, Connection $connection, protected TimeInterface $time, $table = 'key_value_expire')
Before:
public function __construct(RequestStack $request_stack, Connection $connection, MetadataBag $metadata_bag, SessionConfigurationInterface $session_configuration, $handler = NULL)
After:
public function __construct(RequestStack $request_stack, Connection $connection, MetadataBag $metadata_bag, SessionConfigurationInterface $session_configuration, protected TimeInterface $time, $handler = NULL)
Before:
public function __construct(Connection $database, AccountInterface $current_user, EntityTypeManagerInterface $entity_type_manager, StateInterface $state, Connection $database_replica = NULL)
After:
public function __construct(Connection $database, AccountInterface $current_user, EntityTypeManagerInterface $entity_type_manager, StateInterface $state, protected TimeInterface $time, Connection $database_replica = NULL)