Created
June 16, 2015 18:32
-
-
Save dennisdegryse/a0bac4dec64d75c4c8f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PDOFactory { | |
private $dsn; | |
private $username; | |
private $password; | |
private $options; | |
public PDOFactory($dsn, $username, $password, $options = []) { | |
$this->dsn = $dsn; | |
$this->username = $username; | |
$this->password = $password; | |
$this->options = $options; | |
} | |
public function createInstance() { | |
return new PDO($this->dsn, $this->username, $this->password, $this->options); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment