I am trying to load an Sqlite3
extension in a Doctrine 2
project (specifically, the pcre
extension that I have installed via the debian package sqlite3-pcre
).
In a plain PHP project, I would do something similar to
$db = new SQLite3('mysqlitedb.db');
$db->loadExtension('pcre.so');
(as per http://php.net/manual/en/sqlite3.loadextension.php).
My issue is that I do not know where to tell Doctrine to call loadExtension
, or any other way to load that extension.
Side notes :
- The project is a
Symfony 4
project. The reason I useSqlite3
is for my functional tests (the dev and prod environments usePostgresql
). - I have implemented two Doctrine Extensions similar to what is done in the (semi-official ?)
DoctrineExtensions
project (e.g., the one at https://github.com/beberlei/DoctrineExtensions/blob/master/src/Query/Mysql/Regexp.php):- One for
Postgresql
using the~
operator. This one works perfectly. - One for
Sqlite3
using theREGEXP
operator from thepcre
extension. This one complains thatREGEXP
is undefined, since I have not managed to load thepcre
extension.
- One for
I'd be thankful to hear any idea about how to tackle the issue.