GitInfo: Allow cache to be in the extension directory itself
authorKunal Mehta <legoktm@member.fsf.org>
Mon, 4 Jan 2016 17:39:09 +0000 (09:39 -0800)
committerKunal Mehta <legoktm@member.fsf.org>
Wed, 6 Jan 2016 22:41:36 +0000 (14:41 -0800)
commita5ed38dc54af849098b4137bf0a04ca2f18b5e6d
treec0cfa2b2ad92edc007e80cf28b3b7ddbd067990b
parentbff6889af16bf441fdd1babf6420dab3fd00b84f
GitInfo: Allow cache to be in the extension directory itself

For ExtensionDistributor to provide git metadata, we need to be able to
store the cache file inside the extension directory itself. The GitInfo
class will now first check if the $wgGitInfoCacheDirectory is populated,
otherwise it will fallback to "$extensionDir/gitinfo.json".

Bug: T122769
Change-Id: Ib3457589ca6899925ae4610cfcdae22af8eaaaeb
includes/GitInfo.php
tests/phpunit/data/gitinfo/extension/gitinfo.json [new file with mode: 0644]
tests/phpunit/includes/GitInfoTest.php