0.2.3
This commit is contained in:
parent
1920374639
commit
fbf2aaae07
|
@ -11,4 +11,9 @@ class PostgresConnector implements IConnector {
|
|||
public function driverEquals(string $driver) {
|
||||
return $driver === 'pgsql';
|
||||
}
|
||||
|
||||
public static function Connect(string $host, int $port, string $database, string $user, string $password) {
|
||||
ConnectionManager::RegisterConnector(new PostgresConnector());
|
||||
ConnectionManager::Connect('pgsql', $host, $port, $database, $user, $password);
|
||||
}
|
||||
}
|
|
@ -2,20 +2,21 @@
|
|||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use Fufle\Demo\Model\Job;
|
||||
use Fufle\ORM\Database\ConnectionManager;
|
||||
//use Fufle\ORM\Database\ConnectionManager;
|
||||
use Fufle\ORM\Database\Connectors\PostgresConnector;
|
||||
|
||||
//$dns = 'pgsql:host=localhost;port=5432;dbname=dynamic;user=dynamic;password=password123';
|
||||
$params = [
|
||||
'pgsql',
|
||||
// 'pgsql',
|
||||
'localhost',
|
||||
5432,
|
||||
'dynamic_dev',
|
||||
'dynamic',
|
||||
'Pass@Dyna21',
|
||||
];
|
||||
ConnectionManager::RegisterConnector(new PostgresConnector());
|
||||
ConnectionManager::Connect(...$params);
|
||||
PostgresConnector::Connect(...$params);
|
||||
//ConnectionManager::RegisterConnector(new PostgresConnector());
|
||||
//ConnectionManager::Connect(...$params);
|
||||
echo "
|
||||
|
||||
";
|
||||
|
|
Loading…
Reference in New Issue