You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #43585 [Lock] Remove support of Doctrine DBAL in PdoStore (GromNaN)
This PR was merged into the 6.0 branch.
Discussion
----------
[Lock] Remove support of Doctrine DBAL in PdoStore
| Q | A
| ------------- | ---
| Branch? | 6.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#42962
| License | MIT
| Doc PR | no
Commits
-------
b7b0095 [Lock] Remove support of Doctrine DBAL in PdoStore
thrownew \TypeError(sprintf('Argument 1 passed to "%s()" must be "%s" or string, "%s" given.', Connection::class, __METHOD__, get_debug_type($connOrUrl)));
if ($connOrDsninstanceof Connection || (\is_string($connOrDsn) && str_contains($connOrDsn, '://'))) {
74
-
trigger_deprecation('symfony/lock', '5.4', 'Usage of a DBAL Connection with "%s" is deprecated and will be removed in symfony 6.0. Use "%s" instead.', __CLASS__, DoctrineDbalStore::class);
thrownewInvalidTtlException(sprintf('"%s()" expects a TTL greater or equals to 1 second. Got "%s".', __METHOD__, $ttl));
148
125
}
@@ -171,12 +148,6 @@ public function putOffExpiration(Key $key, float $ttl)
171
148
*/
172
149
publicfunctiondelete(Key$key)
173
150
{
174
-
if (isset($this->dbalStore)) {
175
-
$this->dbalStore->delete($key);
176
-
177
-
return;
178
-
}
179
-
180
151
$sql = "DELETE FROM $this->table WHERE $this->idCol = :id AND $this->tokenCol = :token";
181
152
$stmt = $this->getConnection()->prepare($sql);
182
153
@@ -190,10 +161,6 @@ public function delete(Key $key)
190
161
*/
191
162
publicfunctionexists(Key$key): bool
192
163
{
193
-
if (isset($this->dbalStore)) {
194
-
return$this->dbalStore->exists($key);
195
-
}
196
-
197
164
$sql = "SELECT 1 FROM $this->table WHERE $this->idCol = :id AND $this->tokenCol = :token AND $this->expirationCol > {$this->getCurrentTimestampStatement()}";
198
165
$stmt = $this->getConnection()->prepare($sql);
199
166
@@ -222,12 +189,6 @@ private function getConnection(): \PDO
222
189
*/
223
190
publicfunctioncreateTable(): void
224
191
{
225
-
if (isset($this->dbalStore)) {
226
-
$this->dbalStore->createTable();
227
-
228
-
return;
229
-
}
230
-
231
192
// connect if we are not yet
232
193
$conn = $this->getConnection();
233
194
$driver = $this->getDriver();
@@ -255,22 +216,6 @@ public function createTable(): void
255
216
$conn->exec($sql);
256
217
}
257
218
258
-
/**
259
-
* Adds the Table to the Schema if it doesn't exist.
260
-
*
261
-
* @deprecated since symfony/lock 5.4 use DoctrineDbalStore instead
0 commit comments