/**
* ParserOptions is lazy initialised.
- * Access should probably be protected.
*/
function getParserOptions() {
if ( !$this->mParserOptions ) {
global $wgLocalMessageCache;
$filename = "$wgLocalMessageCache/messages-" . wfWikiID() . "-$code";
- wfMkdirParents( $wgLocalMessageCache, 0777 ); // might fail
+ wfMkdirParents( $wgLocalMessageCache ); // might fail
wfSuppressWarnings();
$file = fopen( $filename, 'w' );
$filename = "$wgLocalMessageCache/messages-" . wfWikiID() . "-$code";
$tempFilename = $filename . '.tmp';
- wfMkdirParents( $wgLocalMessageCache, 0777 ); // might fail
+ wfMkdirParents( $wgLocalMessageCache ); // might fail
wfSuppressWarnings();
$file = fopen( $tempFilename, 'w');
* @param bool $isFullKey Specifies whether $key is a two part key "lang/msg".
*/
function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) {
- global $wgContLanguageCode, $wgContLang, $wgLang;
-
- # Identify which language to get or create a language object for.
- if( $langcode === $wgContLang->getCode() || $langcode === true ) {
- # $langcode is the language code of the wikis content language object.
- # or it is a boolean and value is true
- $lang =& $wgContLang;
- } elseif( $langcode === $wgLang->getCode() || $langcode === false ) {
- # $langcode is the language code of user language object.
- # or it was a boolean and value is false
- $lang =& $wgLang;
- } else {
- $validCodes = array_keys( Language::getLanguageNames() );
- if( in_array( $langcode, $validCodes ) ) {
- # $langcode corresponds to a valid language.
- $lang = Language::factory( $langcode );
- } else {
- # $langcode is a string, but not a valid language code; use content language.
- $lang =& $wgContLang;
- wfDebug( 'Invalid language code passed to MessageCache::get, falling back to content language.' );
- }
- }
+ global $wgContLanguageCode, $wgContLang;
+ $lang = wfGetLangObj( $langcode );
$langcode = $lang->getCode();
# If uninitialised, someone is trying to call this halfway through Setup.php
return $message;
}
- global $wgParser;
+ global $wgParser, $wgParserConf;
if ( !$this->mParser && isset( $wgParser ) ) {
# Do some initialisation so that we don't have to do it twice
$wgParser->firstCallInit();
# Clone it and store it
- $this->mParser = clone $wgParser;
+ $class = $wgParserConf['class'];
+ if ( $class == 'Parser_DiffTest' ) {
+ # Uncloneable
+ $this->mParser = new $class( $wgParserConf );
+ } else {
+ $this->mParser = clone $wgParser;
+ }
#wfDebug( __METHOD__ . ": following contents triggered transform: $message\n" );
}
if ( $this->mParser ) {