From f5060b5a1d25b88b606268321762352d85fad5e1 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 4 Mar 2021 21:23:10 +0100 Subject: [PATCH] Adjust documentation to allow for direct usage of database component --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e5f47bf..3d74f74 100644 --- a/README.md +++ b/README.md @@ -109,11 +109,11 @@ Migrating from an earlier version of this project? See our [upgrade guide](Migra // or -// $db = new \Delight\Db\PdoDsn('mysql:dbname=my-database;host=localhost;charset=utf8mb4', 'my-username', 'my-password'); +// $db = \Delight\Db\PdoDatabase::fromDsn(new \Delight\Db\PdoDsn('mysql:dbname=my-database;host=localhost;charset=utf8mb4', 'my-username', 'my-password')); // or -// $db = new \Delight\Db\PdoDsn('pgsql:dbname=my-database;host=localhost;port=5432', 'my-username', 'my-password'); +// $db = \Delight\Db\PdoDatabase::fromDsn(new \Delight\Db\PdoDsn('pgsql:dbname=my-database;host=localhost;port=5432', 'my-username', 'my-password')); // or -// $db = new \Delight\Db\PdoDsn('sqlite:../Databases/my-database.sqlite'); +// $db = \Delight\Db\PdoDatabase::fromDsn(new \Delight\Db\PdoDsn('sqlite:../Databases/my-database.sqlite')); $auth = new \Delight\Auth\Auth($db); ``` @@ -130,6 +130,8 @@ During the lifetime of a session, some user data may be changed remotely, either If all your database tables need a common database name, schema name, or other qualifier that must be specified explicitly, you can optionally pass that qualifier to the constructor as the sixth parameter, which is named `$dbSchema`. +If you want to use a `PdoDatabase` instance (e.g. `$db`) independently as well, please refer to the [documentation of the database library](https://github.com/delight-im/PHP-DB). + ### Registration (sign up) ```php