Revert r19877; no reason is given for it but it breaks things such as parameter subst...
[lhc/web/wiklou.git] / includes / FileStore.php
index 69e4be8..1fd35b0 100644 (file)
@@ -36,6 +36,9 @@ class FileStore {
         * @fixme Probably only works on MySQL. Abstract to the Database class?
         */
        static function lock() {
+               global $wgDBtype;
+               if ($wgDBtype != 'mysql')
+                       return true;
                $dbw = wfGetDB( DB_MASTER );
                $lockname = $dbw->addQuotes( FileStore::lockName() );
                $result = $dbw->query( "SELECT GET_LOCK($lockname, 5) AS lockstatus", __METHOD__ );
@@ -54,16 +57,18 @@ class FileStore {
         * Release the global file store lock.
         */
        static function unlock() {
+               global $wgDBtype;
+               if ($wgDBtype != 'mysql')
+                       return true;
                $dbw = wfGetDB( DB_MASTER );
                $lockname = $dbw->addQuotes( FileStore::lockName() );
                $result = $dbw->query( "SELECT RELEASE_LOCK($lockname)", __METHOD__ );
-               $row = $dbw->fetchObject( $result );
+               $dbw->fetchObject( $result );
                $dbw->freeResult( $result );
        }
        
        private static function lockName() {
-               global $wgDBname, $wgDBprefix;
-               return "MediaWiki.{$wgDBname}.{$wgDBprefix}FileStore";
+               return 'MediaWiki.' . wfWikiID() . '.FileStore';
        }
        
        /**