From: Tim Starling Date: Sat, 28 May 2005 06:57:59 +0000 (+0000) Subject: fixed check for old cache values in commons, and some other stuff X-Git-Tag: 1.5.0alpha2~74 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=42399f8c9129e2ac0f5abfde332028e23fab179d;p=lhc%2Fweb%2Fwiklou.git fixed check for old cache values in commons, and some other stuff --- diff --git a/includes/Image.php b/includes/Image.php index 4882e23bc9..e93d669d36 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -119,7 +119,7 @@ class Image # in shared repository has not changed if ( isset( $keys[1] ) ) { $commonsCachedValues = $wgMemc->get( $keys[1] ); - if (!empty($commonsCachedValues) && is_array($commonsCachedValues) && isset($commonsCachedValues['width'])) { + if (!empty($commonsCachedValues) && is_array($commonsCachedValues) && isset($commonsCachedValues['mime'])) { $this->name = $commonsCachedValues['name']; $this->imagePath = $commonsCachedValues['imagePath']; $this->fileExists = $commonsCachedValues['fileExists']; @@ -309,7 +309,9 @@ class Image $name = $wgLang->ucfirst($this->name); $row = $dbr->selectRow( "`$wgSharedUploadDBname`.image", - array( 'img_size', 'img_width', 'img_height', 'img_bits', 'img_media_type', 'img_major_mime', 'img_minor_mime' ), + array( + 'img_size', 'img_width', 'img_height', 'img_bits', + 'img_media_type', 'img_major_mime', 'img_minor_mime', 'img_metadata' ), array( 'img_name' => $name ), $fname ); if ( $row ) { $this->fromSharedDirectory = true; @@ -338,6 +340,7 @@ class Image # Unconditionally set loaded=true, we don't want the accessors constantly rechecking $this->dataLoaded = true; + wfProfileOut( $fname ); } /* @@ -390,11 +393,14 @@ class Image function upgradeRow() { global $wgDBname, $wgSharedUploadDBname; $fname = 'Image::upgradeRow'; + wfProfileIn( $fname ); + $this->loadFromFile(); $dbw =& wfGetDB( DB_MASTER ); if ( $this->fromSharedDirectory ) { if ( !$wgSharedUploadDBname ) { + wfProfileOut( $fname ); return; } @@ -429,6 +435,7 @@ class Image if ( $this->fromSharedDirectory ) { $dbw->selectDB( $wgDBname ); } + wfProfileOut( $fname ); } /** @@ -1125,7 +1132,7 @@ class Image || !$db->fieldExists( 'image', 'img_metadata' ) || !$db->fieldExists( 'image', 'img_width' ) ) { - wfDebugDieBacktrace( 'Database schema not up to date, please run maintenance/updater.php' ); + wfDebugDieBacktrace( 'Database schema not up to date, please run maintenance/update.php' ); } }