Skip to content

Commit

Permalink
Allow PDO option aliases (phalcon#13080)
Browse files Browse the repository at this point in the history
* Allow PDO option aliases

See phalcon#13010

* fixing syntax error
  • Loading branch information
cottton authored and chilimatic committed Jan 15, 2018
1 parent 5ad14d7 commit bd4ddef
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions phalcon/db/adapter/pdo.zep
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ abstract class Pdo extends Adapter
let options = [];
}

/**
* Check for \PDO::XXX class constant aliases
*/
for key, value in options {
if typeof key == "string" && defined("\PDO::" . key->upper()) {
let options[constant("\PDO::" . key->upper())] = value;
unset options[key];
}
}

/**
* Check if the connection must be persistent
*/
Expand Down

0 comments on commit bd4ddef

Please sign in to comment.