Пример #1
0
 public function __construct($sDSN, $sUsername = null, $sPassword = null, array $aOptions = array(), array $aAttributes = array(), array $aPostConnectCommands = [])
 {
     // Parent construct
     parent::__construct($sDSN, $sUsername, $sPassword, $aOptions, $aAttributes);
     // Attributes
     $this->aPostConnectCommands = $aPostConnectCommands;
 }
Пример #2
0
 public function __construct($dsn, $username = null, $password = null, array $options = array(), array $attributes = array())
 {
     parent::__construct($dsn, $username, $password, $options, $attributes);
     if (\App::getInstance()->singleton('container')->isDebug()) {
         $this->setProfiler(new \Aura\Sql\Profiler());
         $this->getProfiler()->setActive(true);
         $this->debug = true;
     }
 }
Пример #3
0
 /**
  * ExtendedPdo constructor.
  * @param string $db
  * @param string $user
  * @param string $pass
  * @param array $options
  * @param string $type
  * @param string $server
  */
 public function __construct($db, $user, $pass, array $options = [], $type = 'mysql', $server = 'localhost')
 {
     $dsn = $type . ':host=' . $server . ';dbname=' . $db;
     parent::__construct($dsn, $user, $pass, $options);
 }
Пример #4
0
 public function __construct(Config $config)
 {
     $dsn = $config->get('db.driver') . ':dbname=' . $config->get('db.name', 'eden') . ';host=' . $config->get('db.host', 'localhost');
     parent::__construct($dsn, $config->get('db.user'), $config->get('db.pass'), $config->get('db.options'), $config->get('db.attributes'));
 }