Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The serializer service is passed as new parameter to DatabaseBackendFactory and DatabaseBackend constructors #887

Open
github-actions bot opened this issue Oct 20, 2024 · 0 comments
Labels

Comments

@github-actions
Copy link

https://www.drupal.org/node/3014688

Introduced in branch/version: 10.3.x / 10.3.0

The serializer service is passed now as a new parameter to DatabaseBackendFactory and DatabaseBackend constructors. Note that, for backward compatibility reasons, the parameter is optional. In Drupal 11.0.x it will be mandatory and the position in constructor signature will change.

Before

In services file:

cache.backend.database:
  class: Drupal\Core\Cache\DatabaseBackendFactory
  arguments: ['@database', '@cache_tags.invalidator.checksum', '@settings']

Service classes:

class DatabaseBackendFactory implements CacheFactoryInterface {
  ...
  public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, Settings $settings = NULL) {
    ...
  }
  ...
}
class DatabaseBackend implements CacheBackendInterface {
  ...
  public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, $bin, $max_rows = NULL) {
    ...
  }
  ...
}

After

In services file:

cache.backend.database:
  class: Drupal\Core\Cache\DatabaseBackendFactory
  arguments: ['@database', '@cache_tags.invalidator.checksum', '@settings', '@serialization.phpserialize']

Service classes:

class DatabaseBackendFactory implements CacheFactoryInterface {
  ...
  public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, Settings $settings = NULL, ObjectAwareSerializationInterface $serializer = NULL) {
    ...
  }
  ...
}
class DatabaseBackend implements CacheBackendInterface {
  ...
  public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, $bin, ObjectAwareSerializationInterface $serializer = NULL, $max_rows = NULL) {
    ...
  }
  ...
}

Other change notices for same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants