/** * Retrieve a database connection attribute. * * @param string $attribute The name of the attribute to retrieve, * e.g. PDO::ATTR_AUTOCOMMIT * * @return mixed A successful call returns the value of the requested attribute. * An unsuccessful call returns null. */ public function getAttribute($attribute) { switch ($attribute) { case self::PROPEL_ATTR_CACHE_PREPARES: return $this->isCachePreparedStatements; break; default: return $this->connection->getAttribute($attribute); } }
/** * Returns current database driver. * * @return string[] */ protected function getDriver() { $driver = $this->con ? $this->con->getAttribute(\PDO::ATTR_DRIVER_NAME) : null; if (null === $driver && ($currentDSN = $this->getBuiltDsn())) { $driver = explode(':', $currentDSN)[0]; } $db = strtolower(getenv('DB')); if (!$db || 'agnostic' === $db) { $db = 'mysql'; } return $db ?: strtolower($driver); }