diff --git a/src/Controller/HomepageController.php b/src/Controller/HomepageController.php index 0dd55c1e..b9126867 100644 --- a/src/Controller/HomepageController.php +++ b/src/Controller/HomepageController.php @@ -84,8 +84,6 @@ class HomepageController extends AbstractController */ public function homepage(Request $request, GitVersionInfo $versionInfo): Response { - throw new \RuntimeException("Test"); - if ($this->isGranted('@tools.lastActivity')) { $table = $this->dataTable->createFromType( LogDataTable::class, diff --git a/src/Doctrine/SQLiteRegexExtension.php b/src/Doctrine/SQLiteRegexExtension.php new file mode 100644 index 00000000..fe24ae9a --- /dev/null +++ b/src/Doctrine/SQLiteRegexExtension.php @@ -0,0 +1,40 @@ +getConnection(); + + //We only execute this on SQLite databases + if ($connection->getDatabasePlatform() instanceof SqlitePlatform) { + $native_connection = $connection->getNativeConnection(); + + //Ensure that the function really exists on the connection, as it is marked as experimental according to PHP documentation + if($native_connection instanceof \PDO && method_exists($native_connection, 'sqliteCreateFunction' )) { + $native_connection->sqliteCreateFunction('REGEXP', function ($pattern, $value) { + return (false !== mb_ereg($pattern, $value)) ? 1 : 0; + }); + } + } + } + + public function getSubscribedEvents() + { + return[ + Events::postConnect + ]; + } +} \ No newline at end of file