aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2014-07-16 15:06:59 +0200
committerAndreas Fischer <bantu@owncloud.com>2014-07-16 15:13:35 +0200
commitd8bd8c4b6693792024ac1b740b7bc38ae46387d8 (patch)
tree387c85e4056c14208aaffe6eae7b4fd6af1b7ec7
parente26612244af029a794751d0d93a9ac419aef53db (diff)
downloadnextcloud-server-d8bd8c4b6693792024ac1b740b7bc38ae46387d8.tar.gz
nextcloud-server-d8bd8c4b6693792024ac1b740b7bc38ae46387d8.zip
Document why we have to check with defined() first.
-rw-r--r--lib/private/db/connectionfactory.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/private/db/connectionfactory.php b/lib/private/db/connectionfactory.php
index c132a2321cd..033065bcb77 100644
--- a/lib/private/db/connectionfactory.php
+++ b/lib/private/db/connectionfactory.php
@@ -61,6 +61,8 @@ class ConnectionFactory {
throw new \InvalidArgumentException("Unsupported type: $type");
}
$result = $this->defaultConnectionParams[$normalizedType];
+ // \PDO::MYSQL_ATTR_FOUND_ROWS may not be defined, e.g. when the MySQL
+ // driver is missing. In this case, we won't be able to connect anyway.
if ($normalizedType === 'mysql' && defined('\PDO::MYSQL_ATTR_FOUND_ROWS')) {
$result['driverOptions'] = array(
\PDO::MYSQL_ATTR_FOUND_ROWS => true,