Attempts to build a functional test where soundex() is required fail due to the fact that the function by default is not compiled in pdo_sqlite. Functional tests are being built using LiipFunctionalTestBundle.
The error reported is:
PDOException: SQLSTATE[HY000]: General error: 1 no such function: Soundex
and the SQLite documentation says:
The soundex(X) function ... is omitted from SQLite by default
I've tried (from php docs) $db->sqliteCreateFunction('soundex', 'sqlite_soundex', 1);
where
function sqlite_soundex($string)
{
return soundex($string);
}
but get
...sqlite_soundex is not callable...
So, how to compile a version of Windows php_pdo_sqlite.dll
? (SQLite docs show how to compile a "plain" sqlite.dll.) Or is there a better solution?
Edit - with MS Visual Studio 12 Express, compile time option unknown!
>cl sqlite3.c -SQLITE_SOUNDEX -link -dll -out:php_pdo_sqlite.dll
Microsoft (R) C/C++ Optimizing Compiler Version 17.00.50727.1 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9002 : ignoring unknown option '-SQLITE_SOUNDEX'
sqlite3.c
Microsoft (R) Incremental Linker Version 11.00.50727.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:sqlite3.exe
-dll
-out:php_pdo_sqlite.dll
sqlite3.obj