Index: trunk/phase3/includes/LocalisationCache.php |
— | — | @@ -710,6 +710,28 @@ |
711 | 711 | $this->loadedItems[$code][$key] = true; |
712 | 712 | } |
713 | 713 | |
| 714 | + # Write data to the persistant store |
| 715 | + $this->saveLangInStore( $code, $data ); |
| 716 | + |
| 717 | + wfProfileOut( __METHOD__ ); |
| 718 | + } |
| 719 | + |
| 720 | + /** |
| 721 | + * Helper for recache() this is not mean to be called outside of recache() |
| 722 | + * When the localisation store is null (LCStore_Null), method does nothing. |
| 723 | + * |
| 724 | + * @param $code String: language code to save data for |
| 725 | + * @param $data Array: language data forged by recache() |
| 726 | + */ |
| 727 | + protected function saveLangInStore( $code, $data ) { |
| 728 | + wfProfileIn( __METHOD__ ); |
| 729 | + |
| 730 | + if( $this->store instanceof LCStore_Null ) { |
| 731 | + # No point in saving data to /dev/null |
| 732 | + wfProfileOut( __METHOD__ ); |
| 733 | + return; |
| 734 | + } |
| 735 | + |
714 | 736 | # Save to the persistent cache |
715 | 737 | $this->store->startWrite( $code ); |
716 | 738 | foreach ( $allData as $key => $value ) { |
— | — | @@ -724,11 +746,7 @@ |
725 | 747 | $this->store->finishWrite(); |
726 | 748 | |
727 | 749 | # Clear out the MessageBlobStore |
728 | | - # HACK: If using a null (i.e. disabled) storage backend, we |
729 | | - # can't write to the MessageBlobStore either |
730 | | - if ( !$this->store instanceof LCStore_Null ) { |
731 | | - MessageBlobStore::clear(); |
732 | | - } |
| 750 | + MessageBlobStore::clear(); |
733 | 751 | |
734 | 752 | wfProfileOut( __METHOD__ ); |
735 | 753 | } |
— | — | @@ -1186,4 +1204,4 @@ |
1187 | 1205 | $this->unload( $code ); |
1188 | 1206 | } |
1189 | 1207 | } |
1190 | | -} |
\ No newline at end of file |
| 1208 | +} |