Update oyejorge/less.php to 1.7.0.10
[lhc/web/wiklou.git] / includes / GitInfo.php
index 7f05bb0..14f3cc1 100644 (file)
@@ -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
-        * null if $wgGitInfoCacheDirectory is false (cache disabled).
+        * fallback in the extension directory itself
         * @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';
-                       return "{$wgGitInfoCacheDirectory}/{$fileName}";
+                       $cachePath = "{$wgGitInfoCacheDirectory}/{$fileName}";
+                       if ( is_readable( $cachePath ) ) {
+                               return $cachePath;
+                       }
                }
-               return null;
+
+               return "$repoDir/gitinfo.json";
        }
 
        /**