mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-06 16:16:29 +02:00
Document support for PostgreSQL
This commit is contained in:
@@ -18,9 +18,9 @@ Completely framework-agnostic and database-agnostic.
|
|||||||
|
|
||||||
* PHP 5.6.0+
|
* PHP 5.6.0+
|
||||||
* PDO (PHP Data Objects) extension (`pdo`)
|
* PDO (PHP Data Objects) extension (`pdo`)
|
||||||
* MySQL Native Driver (`mysqlnd`) **or** SQLite driver (`sqlite`)
|
* MySQL Native Driver (`mysqlnd`) **or** PostgreSQL driver (`pgsql`) **or** SQLite driver (`sqlite`)
|
||||||
* OpenSSL extension (`openssl`)
|
* OpenSSL extension (`openssl`)
|
||||||
* MySQL 5.5.3+ **or** MariaDB 5.5.23+ **or** SQLite 3.14.1+ **or** other SQL databases that you create the [schema](Database) for
|
* MySQL 5.5.3+ **or** MariaDB 5.5.23+ **or** PostgreSQL 9.5.10+ **or** SQLite 3.14.1+ **or** other SQL databases that you create the [schema](Database) for
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -39,6 +39,7 @@ Completely framework-agnostic and database-agnostic.
|
|||||||
1. Set up a database and create the required tables:
|
1. Set up a database and create the required tables:
|
||||||
|
|
||||||
* [MySQL](Database/MySQL.sql)
|
* [MySQL](Database/MySQL.sql)
|
||||||
|
* [PostgreSQL](Database/PostgreSQL.sql)
|
||||||
* [SQLite](Database/SQLite.sql)
|
* [SQLite](Database/SQLite.sql)
|
||||||
|
|
||||||
## Upgrading
|
## Upgrading
|
||||||
@@ -96,12 +97,16 @@ Migrating from an earlier version of this project? See our [upgrade guide](Migra
|
|||||||
```php
|
```php
|
||||||
// $db = new \PDO('mysql:dbname=my-database;host=localhost;charset=utf8mb4', 'my-username', 'my-password');
|
// $db = new \PDO('mysql:dbname=my-database;host=localhost;charset=utf8mb4', 'my-username', 'my-password');
|
||||||
// or
|
// or
|
||||||
|
// $db = new \PDO('pgsql:dbname=my-database;host=localhost;port=5432', 'my-username', 'my-password');
|
||||||
|
// or
|
||||||
// $db = new \PDO('sqlite:../Databases/my-database.sqlite');
|
// $db = new \PDO('sqlite:../Databases/my-database.sqlite');
|
||||||
|
|
||||||
// or
|
// or
|
||||||
|
|
||||||
// $db = new \Delight\Db\PdoDsn('mysql:dbname=my-database;host=localhost;charset=utf8mb4', 'my-username', 'my-password');
|
// $db = new \Delight\Db\PdoDsn('mysql:dbname=my-database;host=localhost;charset=utf8mb4', 'my-username', 'my-password');
|
||||||
// or
|
// or
|
||||||
|
// $db = 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 = new \Delight\Db\PdoDsn('sqlite:../Databases/my-database.sqlite');
|
||||||
|
|
||||||
$auth = new \Delight\Auth\Auth($db);
|
$auth = new \Delight\Auth\Auth($db);
|
||||||
|
@@ -29,6 +29,8 @@ require __DIR__.'/../vendor/autoload.php';
|
|||||||
|
|
||||||
$db = new \PDO('mysql:dbname=php_auth;host=127.0.0.1;charset=utf8mb4', 'root', 'monkey');
|
$db = new \PDO('mysql:dbname=php_auth;host=127.0.0.1;charset=utf8mb4', 'root', 'monkey');
|
||||||
// or
|
// or
|
||||||
|
// $db = new \PDO('pgsql:dbname=php_auth;host=127.0.0.1;port=5432', 'postgres', 'monkey');
|
||||||
|
// or
|
||||||
// $db = new \PDO('sqlite:../Databases/php_auth.sqlite');
|
// $db = new \PDO('sqlite:../Databases/php_auth.sqlite');
|
||||||
|
|
||||||
$auth = new \Delight\Auth\Auth($db);
|
$auth = new \Delight\Auth\Auth($db);
|
||||||
|
Reference in New Issue
Block a user