Created
May 11, 2012 13:52
-
-
Save tlenclos/2659793 to your computer and use it in GitHub Desktop.
Laravel\Database\Connectors::options(), cannot override the default connection options
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 namespace Laravel\Database\Connectors; use PDO; | |
abstract class Connector { | |
/** | |
* The PDO connection options. | |
* | |
* @var array | |
*/ | |
protected $options = array( | |
PDO::ATTR_CASE => PDO::CASE_LOWER, | |
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, | |
PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, | |
PDO::ATTR_STRINGIFY_FETCHES => false, | |
PDO::ATTR_EMULATE_PREPARES => false, | |
); | |
/** | |
* Establish a PDO database connection. | |
* | |
* @param array $config | |
* @return PDO | |
*/ | |
abstract public function connect($config); | |
/** | |
* Get the PDO connection options for the configuration. | |
* | |
* Developer specified options will override the default connection options. | |
* | |
* @param array $config | |
* @return array | |
*/ | |
protected function options($config) | |
{ | |
$options = (isset($config['options'])) ? $config['options'] : array(); | |
- return $this->options + $options; | |
+ return $options + $this->options; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment