dokufreaks/plugin-blogtng

support for sqlite PDO interface

Closed this issue · 9 comments

Redhat and CentOS does not provide the php-sqlite* extensions, just the PDO driver for sqlite.
Is it possible for blogtng to use the sqlite dokuwiki plugin instead of accessing the database directly. This would allow to use the pdo version of that plugin. Otherwise: Is it possible to change the blogtng code to use the pdo interface instead of php-sqlite? Or would that break installations for other users?

We could contribute patches in case this change is welcome...

Patches to make BlogTNG use the sqlite plugin would be welcome.

Very happy if we can support sqlite PDO interface. If other distros also complied PDO by default , why don't we support PDO directly ? Otherwise, a patch is also welcomed.

I created a PDO branch and just commited the first rewrite. It replaces the sqlite-helper with a generic database-helper and is applied to the uses in the other source files.

The generic approach removes the automatic database creation and update from the database helper. I need to put that into the admin interface and let the user do the initial setup and updates.

Hello @dploeger , thanks for the work done on PDO.
Do you need some testing/feedback for the PDO branch ? Is it suitable for production use ?

I'm sorry, I retired from the blogtng repository. I think my PDO branch is far from production use. Sorry.

The branch https://github.com/dokufreaks/plugin-blogtng/tree/usesqlitehelperplugin adds a dependency with the sqlite plugin to the BlogTNG.

The sqlite helper plugin has support for sqlite2 and sqlite3 and is used for a couple other plugins too. Also has this plugin some bits to help users to upgrade their database.
My first tests seems to indicate it is quite stable.

The next tests still need to be performed: sqlite tests. I haven't anymore an installation with both sqlite2 and sqlite3 at the moment, so when you have, please consider performing these tests.

To be absolute sure you will lost nothing, you can backup the original database located at [dokuwiki]/data/meta/blogtng.sqlite.

When this branch is stable i will propose to merge it with the master branch. Report issues in this tracker please.

btw: the sqlite helper plugin uses PDO to provide sqlite3 support.

some crossposting:
There is a update available for the BlogTNG that will use the sqlite plugin (please install separately) as sqlite backend. At the moment it is still in the branch usesqlitehelperplugin , but i think it is ready for integration in the master branch.

When you have the possibility to test, please try it and report whether it is successful!

Some info is available at the wiki page:
https://www.dokuwiki.org/plugin:blogtng#download_and_installation

The branch is merged with master. Updated version is now available from the download url at the wiki page.