From d8bd8c4b6693792024ac1b740b7bc38ae46387d8 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 16 Jul 2014 15:06:59 +0200 Subject: [PATCH] Document why we have to check with defined() first. --- lib/private/db/connectionfactory.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/private/db/connectionfactory.php b/lib/private/db/connectionfactory.php index c132a2321c..033065bcb7 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,