aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/GitInfoTest.php
diff options
context:
space:
mode:
authorBryan Davis <bd808@wikimedia.org>2014-06-26 13:05:29 -0600
committerReedy <reedy@wikimedia.org>2014-07-08 16:36:10 +0000
commitb6d18ab9f70ee8b7dcea0a5347f278faf83ba111 (patch)
treec0e1ad60657fbc9c9ef21b5917bc92bb62f8d491 /tests/phpunit/includes/GitInfoTest.php
parent60b05541cdb08ae9f9512735bbc0f4730fe11ed7 (diff)
downloadmediawikicore-b6d18ab9f70ee8b7dcea0a5347f278faf83ba111.tar.gz
mediawikicore-b6d18ab9f70ee8b7dcea0a5347f278faf83ba111.zip
Fix GitInfo cache file path computation and storage location
Depending on the configuration used in LocalSettings.php, $IP can be changed between the time that configuration is loaded and the wiki runtime by logic in WebStart.php. Attempt to mitigate the effects of such changes on the cache file name computation by canonicalizing both $IP and the path using PHP's realpath() function. Related but distinct is the possible need to configure the canonical location for finding cache files on disk separately from $wgCacheDirectory. This change introduces a new configuration variable named $wgGitInfoCacheDirectory that can be set to a path that diverges from the default location of $wgCacheDirectory/gitinfo. This will be useful in the WMF cluster where $wgCacheDirectory points to a directory that is not managed by the deployment system. Finally add wfDebugLog logging to make tracking down issues such as miscomputed cache paths easier. Bug: 53972 Change-Id: Iceb9e1ce8d3b4bb08f89fa6ec5d5e7392aaafd46
Diffstat (limited to 'tests/phpunit/includes/GitInfoTest.php')
-rw-r--r--tests/phpunit/includes/GitInfoTest.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/phpunit/includes/GitInfoTest.php b/tests/phpunit/includes/GitInfoTest.php
index 7c684d51e19a..e22f50507ec1 100644
--- a/tests/phpunit/includes/GitInfoTest.php
+++ b/tests/phpunit/includes/GitInfoTest.php
@@ -6,7 +6,7 @@ class GitInfoTest extends MediaWikiTestCase {
protected function setUp() {
parent::setUp();
- $this->setMwGlobals( 'wgCacheDirectory', __DIR__ . '/../data' );
+ $this->setMwGlobals( 'wgGitInfoCacheDirectory', __DIR__ . '/../data/gitinfo' );
}
public function testValidJsonData() {