Index: trunk/extensions/Translate/utils/TranslateMetadata.php |
— | — | @@ -11,6 +11,8 @@ |
12 | 12 | */ |
13 | 13 | |
14 | 14 | class TranslateMetadata { |
| 15 | + protected static $cache = null; |
| 16 | + |
15 | 17 | /** |
16 | 18 | * Get a metadata value for the given group and key. |
17 | 19 | * @param $group The group name |
— | — | @@ -18,13 +20,12 @@ |
19 | 21 | * @return String |
20 | 22 | */ |
21 | 23 | public static function get( $group, $key ) { |
22 | | - static $cache = null; |
23 | | - if ( $cache === null ) { |
| 24 | + if ( self::$cache === null ) { |
24 | 25 | $dbr = wfGetDB( DB_SLAVE ); |
25 | 26 | $cache = $dbr->select( 'translate_metadata', '*', array(), __METHOD__ ); |
26 | 27 | } |
27 | 28 | |
28 | | - foreach ( $cache as $row ) { |
| 29 | + foreach ( self::$cache as $row ) { |
29 | 30 | if ( $row->tmd_group === $group && $row->tmd_key === $key ) { |
30 | 31 | return $row->tmd_value; |
31 | 32 | } |
— | — | @@ -48,6 +49,8 @@ |
49 | 50 | } else { |
50 | 51 | $dbw->replace( 'translate_metadata', array( array( 'tmd_group', 'tmd_key' ) ), $data, __METHOD__ ); |
51 | 52 | } |
| 53 | + |
| 54 | + $this->cache = null; |
52 | 55 | } |
53 | 56 | |
54 | 57 | } |