semsol / arc2

ARC RDF Classes for PHP
Other
332 stars 89 forks source link

Use adapter-approach to allow usage of mysqli, PDO, ... #109

Closed k00ni closed 6 years ago

k00ni commented 6 years ago

It would allow us to avoid breaking changes and opens the door for further adapters.

For now, i would suggest:

Selected adapter when provide the DB configuration.

for mysqli

In general, you don't have to do anything, because the system uses mysqli adapter as default. But you can be explicit:

$dbConfig = [
    // ...
    'db_adapter' => 'mysqli',
];

for PDO

$dbConfig = [
    // ...
    'db_adapter' => 'pdo',
    'db_pdo_protocol' => 'mysql'
];
k00ni commented 6 years ago

Implemented.