SQLite / PDO support (wp-content/db.php)
-
It seems the firewall relies on mysql(i) so we can not use other databases, for example SQLite for demonstration purposes, or any other PDO connection.
We use https://github.com/aaemnnosttv/wp-sqlite-db with the WP-CLI server (but had to switch to the original PHP server, see also https://github.com/wp-cli/server-command/issues/71):
https://github.com/DanielRuf/run-local-wordpress/blob/main/run-local-wordpress.sh
The alternative solution
php -c .../.user.ini -S localhost:8080 -t .also works but there is just a small warning in the backend then:Warning: Undefined array key "SERVER_ADDR" in .../wp-content/plugins/ninjafirewall/lib/dashboard.php on line 503There seems to be a simple solution with PDO (https://www.php.net/manual/en/book.pdo.php):
https://gist.github.com/DanielRuf/71eb70dc1dcf6503ce200871e2dfe25f/revisions#diff-cd52ce92891b0bf41db78d09547f2fc9e5ef21c5a1510b517fe6f6627a22a52f (very simple solution, there may be more parts that have to be changed)
PDO allows us to use more than just MySQL / MariaDB, see the list at https://www.php.net/manual/en/pdo.drivers.php
At least it works now locally, in the backend it says
NinjaFirewall is running in Full WAF mode.and the requests are correctly blocked.
The topic ‘SQLite / PDO support (wp-content/db.php)’ is closed to new replies.