/** Write the main page as index.html */
function doMainPage() {
- global $wgMakeDumpLinks;
print "Making index.html ";
// Set up globals with no ../../.. in the link URLs
$this->setupGlobals( 0 );
- // But still use that directory style
- $wgMakeDumpLinks = 3;
-
$title = Title::newMainPage();
$text = $this->getArticleHTML( $title );
$file = fopen( "{$this->dest}/index.html", "w" );
$fname = 'DumpHTML::doImageDescriptions';
- $this->setupGlobals( 3 );
+ $this->setupGlobals();
/**
* Dump image description pages that don't have an associated article, but do
}
/** Set up globals required for parsing */
- function setupGlobals( $depth = NULL ) {
- global $wgUser, $wgTitle, $wgMakeDumpLinks, $wgStylePath, $wgArticlePath;
+ function setupGlobals( $currentDepth = NULL ) {
+ global $wgUser, $wgTitle, $wgStylePath, $wgArticlePath;
global $wgUploadPath, $wgLogo, $wgMaxCredits, $wgSharedUploadPath;
global $wgHideInterlanguageLinks, $wgUploadDirectory, $wgThumbnailScriptPath;
global $wgSharedThumbnailScriptPath, $wgEnableParserCache, $wgHooks, $wgServer;
$this->oldArticlePath = $wgServer . $wgArticlePath;
}
- if ( is_null( $depth ) ) {
- $wgMakeDumpLinks = $this->depth;
- } else {
- $wgMakeDumpLinks = $depth;
+ if ( is_null( $currentDepth ) ) {
+ $currentDepth = $this->depth;
}
if ( $this->alternateScriptPath ) {
- if ( $wgMakeDumpLinks == 0 ) {
+ if ( $currentDepth == 0 ) {
$wgScriptPath = '.';
} else {
- $wgScriptPath = '..' . str_repeat( '/..', $wgMakeDumpLinks - 1 );
+ $wgScriptPath = '..' . str_repeat( '/..', $currentDepth - 1 );
}
} else {
- $wgScriptPath = '..' . str_repeat( '/..', $wgMakeDumpLinks );
+ $wgScriptPath = '..' . str_repeat( '/..', $currentDepth );
}
- $wgArticlePath = str_repeat( '../', $wgMakeDumpLinks ) . '$1';
+ $wgArticlePath = str_repeat( '../', $currentDepth ) . '$1';
# Logo image
# Allow for repeated setup
$ns = $wgTitle->getNamespace();
if ( $ns == NS_SPECIAL ) {
+ $wgOut = new OutputPage;
+ $wgOut->setParserOptions( new ParserOptions );
+ $wgLinkCache = new LinkCache;
SpecialPage::executePath( $wgTitle );
} else {
if ( $ns == NS_IMAGE ) {
if ( $url === false ) {
$url = str_replace( '$1', wfUrlencode( $this->getHashedFilename( $title ) ), $wgArticlePath );
}
+
return false;
}