Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Pregenerate the mediawiki l10n cache
Browse files Browse the repository at this point in the history
 - only affects warmup, not results
 - allows use of patch from https://phabricator.wikimedia.org/T99740 with
   repo-auth mode
  • Loading branch information
fredemmott committed May 20, 2015
1 parent 766f779 commit 7983587
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion targets/mediawiki/MediaWikiTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public function install(): void {
->setDumpFile(__DIR__.'/mw_bench.sql.gz')
->installDatabase();

$cache_dir = $this->options->tempDir.'/mw-cache';
// Put it inside the source root so that if we're generating PHP files and
// we're in repo-auth mode, the generated files end up in the repo
$cache_dir = $this->getSourceRoot().'/mw-cache';
mkdir($cache_dir);

file_put_contents(
Expand All @@ -55,6 +57,15 @@ public function install(): void {
);
}

<<__Override>>
public function postInstall(): void {
Utils::RunCommand(Vector {
PHP_BINARY,
$this->getSourceRoot().'/maintenance/rebuildLocalisationCache.php',
'--lang=en',
});
}

public function getSourceRoot(): string {
return $this->options->tempDir.'/mediawiki';
}
Expand Down

0 comments on commit 7983587

Please sign in to comment.