Cleanup
This commit is contained in:
1 parent
85d20e034a
commit
1bff7f46d7
9 files changed
+40
-12
No files matched your search
@@ -3,17 +3,28 @@
|
||||
namespace Khofmann\Database;
|
||||
|
||||
use PDO;
|
||||
use Config\Config;
|
||||
use Khofmann\Config\Config;
|
||||
use Exception;
|
||||
|
||||
class Database extends PDO
|
||||
{
|
||||
private static array $instances = [];
|
||||
|
||||
protected function __construct(string $dsn, string $username = null, string $password = null, array $options = null)
|
||||
private function __construct(string $dsn, string $username = null, string $password = null, array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
}
|
||||
|
||||
private function __clone()
|
||||
{
|
||||
throw new Exception("Cannot clone a singleton.");
|
||||
}
|
||||
|
||||
private function __wakeup()
|
||||
{
|
||||
throw new Exception("Cannot unserialize a singleton.");
|
||||
}
|
||||
|
||||
public static function getInstance(): Database
|
||||
{
|
||||
$cls = static::class;
|
||||
|
||||
Reference in new issue
Block a user