Skip to content

[Cache] Add PdoTagAwareAdapter #58296

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

Open
wants to merge 18 commits into
base: 7.4
Choose a base branch
from
Prev Previous commit
Next Next commit
Make tag table information configurable
  • Loading branch information
Toflar committed Nov 25, 2024
commit 49d24d19472aa808b30db6c6dcb3f5df46ed37aa
9 changes: 8 additions & 1 deletion src/Symfony/Component/Cache/Adapter/PdoTagAwareAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,28 @@ class PdoTagAwareAdapter extends AbstractTagAwareAdapter implements PruneableInt
* cache is actually used.
*
* List of available options:
* * db_table: The name of the table [default: cache_items]
* * db_table: The name of the cache item table [default: cache_items]
* * db_id_col: The column where to store the cache id [default: item_id]
* * db_data_col: The column where to store the cache data [default: item_data]
* * db_lifetime_col: The column where to store the lifetime [default: item_lifetime]
* * db_time_col: The column where to store the timestamp [default: item_time]
* * db_username: The username when lazy-connect [default: '']
* * db_password: The password when lazy-connect [default: '']
* * db_connection_options: An array of driver-specific connection options [default: []]
* * db_tags_table: The name of the tags table [default: cache_tags]
* * db_tags_col: The column where to store the tags [default: item_tag]
* * db_tags_tag_index_name: The index name for the tags column [default: idx_cache_tags_item_tag]
*
* @throws InvalidArgumentException When first argument is not PDO nor Connection nor string
* @throws InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION
* @throws InvalidArgumentException When namespace contains invalid characters
*/
public function __construct(#[\SensitiveParameter] \PDO|string $connOrDsn, string $namespace = '', int $defaultLifetime = 0, array $options = [], ?MarshallerInterface $marshaller = null)
{
$this->tagsTable = $options['db_tags_table'] ?? $this->tagsTable;
$this->tagCol = $options['db_tags_col'] ?? $this->tagCol;
$this->tagIdxName = $options['db_tags_tag_index_name'] ?? $this->tagIdxName;

$this->init($connOrDsn, $namespace, $defaultLifetime, $options, $marshaller);
}

Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy