Closed bnomei closed 3 years ago
the sqlite file is optimized with pragmas. maybe your slite version does not support them.
please post your sqlite version: echo SQLite3::version();
and try these config values to disable all optimizations.
// other options
'bnomei.sqlite-cachedriver.pragmas-construct' => [],
'bnomei.sqlite-cachedriver.pragmas-destruct' => [],
Hi!
My SQLite version is 3.27.2
I tried disabling the optimizations and now get this error:
SQLite3Stmt::bindValue(): The SQLite3 object has not been correctly initialised
The error is thrown inside kirby3-sqlite-cachedriver/classes/SQLiteCache.php on line 175:
$this->deleteStatement->bindValue(':id', $key, SQLITE3_TEXT);
i am running out of ideas. can you verify with some raw php sqlite commands that sqlite is working at all? like load an existing db? most examples found in google should do.
The SQLite3 extension for php is working fine.
So I tried a fresh Kirby3 installation on a different server with only the Boost + SQLite3CacheDriver plugins. The strange thing is: the Boost plugin seems to work fine with the SQLite Cachedriver, tested all the functions and it works. Though, every time I create a new page via the panel i get this Error:
The JSON response of the API could not be parsed
{"status":"error","exception":"Whoops\\Exception\\ErrorException","code":2,"message":"SQLite3Stmt::bindValue(): The SQLite3 object has not been correctly initialised","details":null,"file":"qlite\/site\/plugins\/kirby3-sqlite-cachedriver\/classes\/SQLiteCache.php","line":175}
But when I refresh, the page is there, with an ID in the boostid field and everything works fine.
thanks for providing more information. i think i have an idea what is causing this.
will you try and remove detructor funciton from the class? and try again? https://github.com/bnomei/kirby3-sqlite-cachedriver/blob/1c1af952cd9aaa9597607a2b5fb136cb4408bba2/classes/SQLiteCache.php#L71
public function __destruct()
{
if ($this->database) {
$this->applyPragmas('pragmas-destruct');
$this->database->close();
}
}
if that fixes it then try again with the constructor but
public function __destruct()
{
if ($this->database) {
$this->applyPragmas('pragmas-destruct');
// $this->database->close(); // 2nd try to just not close the db
}
}
Thanks, that fixed it. Pulled the new commits and tested everything, works like a charm.
Again: great plugin, thanks a lot!!
FORUM https://forum.getkirby.com/t/kirby3-boost-makes-loading-a-lot-of-pages-in-one-request-fast-unique-id/23580/7?u=bnomei
JonasHolfeld Hi again :slight_smile:
A few days later, i wanted to setup everything using the SQL-Lite server, but i get this Error:
Fatal error: Uncaught Error: The SQLite3 object has not been correctly initialised or is already closed in .../site/plugins/kirby3-sqlite- cachedriver/classes/SQLiteCache.php:175 Stack trace: #0 .../site/plugins/kirby3-sqlite-cachedriver/classes/SQLiteCache.php(175): SQLite3Stmt-
site()->boost(); or
var_dump(site()->boostmark()); Do i need to initialize the SQLite Cachedriver plugin somehow?
Thank you!