Class DatabaseConnector
Handles database connection logic for mysqldump-php.
CloneableInstantiable
| Methods |
| public __construct(string $dsn = '', ?string $user = NULL, ?string $pass = NULL, array $pdoOptions = []) Constructor of DatabaseConnector.
|
| public connect() : PDO Connect to the database with PDO.
|
| public getDbName() : string |
| public getHost() : string |
| Properties |
| private ?PDO $conn = NULL |
| private string $dbName |
| private string $dsn |
| private string $host |
| private ?string $pass |
| private array $pdoOptions |
| private ?string $user |
| Methods |
| private parseDsn(string $dsn) : string Parse DSN string and extract dbname value Several examples of a DSN string mysql:host=localhost;dbname=testdb mysql:host=localhost;port=3307;dbname=testdb mysql:unix_socket=/tmp/mysql.sock;dbname=testdb
|