Commit 0073e148 authored by catch's avatar catch

Issue #3145412 by pavnish, cburschka, amateescu: Connection::__destruct()...

Issue #3145412 by pavnish, cburschka, amateescu: Connection::__destruct() can't delete the sqlite file
parent 1a48485e
......@@ -187,9 +187,9 @@ public function __destruct() {
// We can prune the database file if it doesn't have any tables.
if ($count == 0 && $this->connectionOptions['database'] != ':memory:' && file_exists($this->connectionOptions['database'] . '-' . $prefix)) {
// Detaching the database fails at this point, but no other queries
// are executed after the connection is destructed so we can simply
// remove the database file.
// Detach the database.
$this->query('DETACH DATABASE :schema', [':schema' => $prefix]);
// Destroy the database file.
unlink($this->connectionOptions['database'] . '-' . $prefix);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment