/** * @inheritdoc */ public function beforeAction($action) { if (!parent::beforeAction($action)) { return false; } $connection = Yii::$app->get($this->name); $driverName = Driver::driverName($connection); if (!isset($this->drivers[$driverName])) { throw new Exception(Yii::t('yii', 'Unknown database driver: {name}', ['name' => $driverName])); } $this->driver = Yii::createObject($this->drivers[$driverName], [$connection]); return true; }
public function getEnv() { $env = parent::getEnv(); $env['PGPASSWORD'] = $this->dsn['password']; return $env; }
/** * @inheritdoc */ public function init() { parent::init(); $this->dsn['host'] = isset($this->dsn['host']) ? $this->dsn['host'] : $this->host; $this->dsn['port'] = isset($this->dsn['port']) ? $this->dsn['port'] : $this->port; }
public function __construct(Connection $connection, $config = []) { parent::__construct($connection, $config); $this->initDsn($connection); }
public function __construct(Connection $connection, $config = []) { parent::__construct($connection, $config); }