summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuane Johnson <duane.johnson@gmail.com>2014-08-30 15:46:56 -0600
committerDuane Johnson <duane.johnson@gmail.com>2014-08-30 15:46:56 -0600
commitccf440495ef6e6e2b0cf364dc963fdf34be3597d (patch)
tree525b308b7282cffc30dc2d9653244cf34abdb88e
parenta8dc4368c0842d0266e121d6d50217a4226e7a7a (diff)
downloadnextcloud-server-ccf440495ef6e6e2b0cf364dc963fdf34be3597d.tar.gz
nextcloud-server-ccf440495ef6e6e2b0cf364dc963fdf34be3597d.zip
Ensure db connection before changing cache state
When trying to upgrade from 7.0.0 to 7.0.2, the manual upgrade path (e.g. ` sudo -u www-data /usr/bin/php5 ./occ upgrade`) exits with the following fatal error: ``` /var/www/owncloud# php occ upgrade PHP Fatal error: Call to a member function disableQueryStatementCaching() on a non-object in /var/www/owncloud/lib/private/db.php on line 423 ``` This is caused by the self::$connection static variable having not been initialized at the point of call. Adding a self::connect() fixes the issue. See https://forum.owncloud.org/viewtopic.php?f=29&t=23398&p=68556#p68556
-rw-r--r--lib/private/db.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/private/db.php b/lib/private/db.php
index 221a369cad2..80163415a90 100644
--- a/lib/private/db.php
+++ b/lib/private/db.php
@@ -417,6 +417,7 @@ class OC_DB {
* @param bool $enabled
*/
static public function enableCaching($enabled) {
+ self::connect();
if ($enabled) {
self::$connection->enableQueryStatementCaching();
} else {