dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix typo SpecialVersion::getCreditsForExtension comments
[lhc/web/wiklou.git]
/
includes
/
GitInfo.php
diff --git
a/includes/GitInfo.php
b/includes/GitInfo.php
index
7052820
..
14f3cc1
100644
(file)
--- a/
includes/GitInfo.php
+++ b/
includes/GitInfo.php
@@
-96,7
+96,7
@@
class GitInfo {
*
* @param string $repoDir The root directory of the repo where .git can be found
* @return string Path to GitInfo cache file in $wgGitInfoCacheDirectory or
*
* @param string $repoDir The root directory of the repo where .git can be found
* @return string Path to GitInfo cache file in $wgGitInfoCacheDirectory or
- *
null if $wgGitInfoCacheDirectory is false (cache disabled).
+ *
fallback in the extension directory itself
* @since 1.24
*/
protected static function getCacheFilePath( $repoDir ) {
* @since 1.24
*/
protected static function getCacheFilePath( $repoDir ) {
@@
-119,9
+119,13
@@
class GitInfo {
// a filename
$repoName = strtr( $repoName, DIRECTORY_SEPARATOR, '-' );
$fileName = 'info' . $repoName . '.json';
// a filename
$repoName = strtr( $repoName, DIRECTORY_SEPARATOR, '-' );
$fileName = 'info' . $repoName . '.json';
- return "{$wgGitInfoCacheDirectory}/{$fileName}";
+ $cachePath = "{$wgGitInfoCacheDirectory}/{$fileName}";
+ if ( is_readable( $cachePath ) ) {
+ return $cachePath;
+ }
}
}
- return null;
+
+ return "$repoDir/gitinfo.json";
}
/**
}
/**
@@
-281,9
+285,9
@@
class GitInfo {
$config = "{$this->basedir}/config";
$url = false;
if ( is_readable( $config ) ) {
$config = "{$this->basedir}/config";
$url = false;
if ( is_readable( $config ) ) {
-
wfS
uppressWarnings();
+
MediaWiki\s
uppressWarnings();
$configArray = parse_ini_file( $config, true );
$configArray = parse_ini_file( $config, true );
-
wfR
estoreWarnings();
+
MediaWiki\r
estoreWarnings();
$remote = false;
// Use the "origin" remote repo if available or any other repo if not.
$remote = false;
// Use the "origin" remote repo if available or any other repo if not.
@@
-392,7
+396,7
@@
class GitInfo {
if ( self::$viewers === false ) {
self::$viewers = $wgGitRepositoryViewers;
if ( self::$viewers === false ) {
self::$viewers = $wgGitRepositoryViewers;
-
wfRunHooks
( 'GitViewers', array( &self::$viewers ) );
+
Hooks::run
( 'GitViewers', array( &self::$viewers ) );
}
return self::$viewers;
}
return self::$viewers;