Compare commits

..

16 Commits

Author SHA1 Message Date
Dariusz Jaski 1920374639 ns 2021-03-07 11:20:52 +01:00
Dariusz Jaski 1c886fb385 model 2021-03-07 11:17:21 +01:00
Dariusz Jaski b9d1d1601a d 2021-03-07 11:12:43 +01:00
Dariusz Jaski 3f9758c403 fdn 2021-03-07 11:06:39 +01:00
Dariusz Jaski 661406db67 nullsafe 2021-03-07 10:55:23 +01:00
Dariusz Jaski 9c6c34f870 eq 2021-03-07 10:54:11 +01:00
Dariusz Jaski a026facb7c iface 2021-03-07 09:55:06 +01:00
Dariusz Jaski 3c43612503 rename 2021-03-07 09:52:45 +01:00
Dariusz Jaski d32c7a0b92 use 2021-03-07 09:39:13 +01:00
Dariusz Jaski d9da5559c5 NS 2021-03-07 01:53:29 +01:00
Dariusz Jaski afc2b5a261 rename 2021-03-07 01:49:33 +01:00
Dariusz Jaski 54113fffc0 connectors 2021-03-07 01:15:16 +01:00
Michal Sieciechowicz 9204f70e50 0.2.2 2021-03-03 13:41:02 +01:00
Michal Sieciechowicz a3d8bb6131 fixes 2021-03-01 16:25:31 +01:00
Michal Sieciechowicz a3d71c7bc5 fix 2021-03-01 16:22:54 +01:00
Michal Sieciechowicz a3c38a27c7 fixes 2021-03-01 16:06:02 +01:00
3 changed files with 4 additions and 12 deletions

View File

@ -7,5 +7,4 @@ use Fufle\ORM\Database\Credentials;
interface IConnector {
public function getConnectionString(Credentials $credentials);
public function driverEquals(string $driver);
public static function Connect(string $host, int $port, string $database, string $user, string $password);
}

View File

@ -3,7 +3,6 @@
namespace Fufle\ORM\Database\Connectors;
use Fufle\ORM\Database\Credentials;
use Fufle\ORM\Database\ConnectionManager;
class PostgresConnector implements IConnector {
public function getConnectionString(Credentials $c) {
@ -12,9 +11,4 @@ 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);
}
}

View File

@ -2,21 +2,20 @@
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',
];
PostgresConnector::Connect(...$params);
//ConnectionManager::RegisterConnector(new PostgresConnector());
//ConnectionManager::Connect(...$params);
ConnectionManager::RegisterConnector(new PostgresConnector());
ConnectionManager::Connect(...$params);
echo "
";