Re: Configuration in the php.ini file
| From: | Olivier B. | Date: | Fri, 09 Oct 2009 13:31:54 +0000 |
| Subject: | Re: Configuration in the php.ini file | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45711@lists.php.net to get a copy of this message | ||
Hi
There isn't because nobody developed that or because it is contradicted ? here we extends the PDO class to configure it like we want.For example : class ourPDO { public function __construct( $dsn, $user = NULL, $password = NULL, $options = NULL ) {
$defaultOptions = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING,
PDO::ATTR_TIMEOUT => 5,
PDO::ATTR_CASE => PDO::CASE_NATURAL,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
);
if( is_array($options) )
$defaultOptions = $options + $defaultOptions;
parent::__construct($dsn, $user, $password, $defaultOptions);} } and in code, we use $db = new ourPDO( ... );