File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -267,7 +267,11 @@ public function createTable(): void
267267 $ table ->setPrimaryKey ([$ this ->idCol ]);
268268
269269 foreach ($ schema ->toSql ($ conn ->getDatabasePlatform ()) as $ sql ) {
270- $ conn ->exec ($ sql );
270+ if (method_exists ($ conn , 'executeStatement ' )) {
271+ $ conn ->executeStatement ($ sql );
272+ } else {
273+ $ conn ->exec ($ sql );
274+ }
271275 }
272276
273277 return ;
@@ -293,7 +297,11 @@ public function createTable(): void
293297 throw new \DomainException (sprintf ('Creating the lock table is currently not implemented for PDO driver "%s". ' , $ driver ));
294298 }
295299
296- $ conn ->exec ($ sql );
300+ if (method_exists ($ conn , 'executeStatement ' )) {
301+ $ conn ->executeStatement ($ sql );
302+ } else {
303+ $ conn ->exec ($ sql );
304+ }
297305 }
298306
299307 /**
@@ -303,7 +311,12 @@ private function prune(): void
303311 {
304312 $ sql = "DELETE FROM $ this ->table WHERE $ this ->expirationCol <= {$ this ->getCurrentTimestampStatement ()}" ;
305313
306- $ this ->getConnection ()->exec ($ sql );
314+ $ conn = $ this ->getConnection ();
315+ if (method_exists ($ conn , 'executeStatement ' )) {
316+ $ conn ->executeStatement ($ sql );
317+ } else {
318+ $ conn ->exec ($ sql );
319+ }
307320 }
308321
309322 private function getDriver (): string
You can’t perform that action at this time.
0 commit comments