[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/ -> GitInfo.php (summary)

(no description)

File Size: 400 lines (11 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

GitInfo:: (16 methods):
  __construct()
  getCacheFilePath()
  repo()
  isSHA1()
  getHead()
  getHeadSHA1()
  getHeadCommitDate()
  getCurrentBranch()
  getHeadViewUrl()
  getRemoteUrl()
  cacheIsComplete()
  precomputeValues()
  headSHA1()
  currentBranch()
  headViewUrl()
  getViewers()


Class: GitInfo  - X-Ref

A class to help return information about a git repo MediaWiki may be inside
This is used by Special:Version and is also useful for the LocalSettings.php
of anyone working on large branches in git to setup config that show up only
when specific branches are currently checked out.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
http://www.gnu.org/copyleft/gpl.html

__construct( $repoDir, $usePrecomputed = true )   X-Ref

param: string $repoDir The root directory of the repo where .git can be found
param: bool $usePrecomputed Use precomputed information if available

getCacheFilePath( $repoDir )   X-Ref
Compute the path to the cache file for a given directory.

param: string $repoDir The root directory of the repo where .git can be found
return: string Path to GitInfo cache file in $wgGitInfoCacheDirectory or

repo()   X-Ref
Get the singleton for the repo at $IP

return: GitInfo

isSHA1( $str )   X-Ref
Check if a string looks like a hex encoded SHA1 hash

param: string $str The string to check
return: bool Whether or not the string looks like a SHA1

getHead()   X-Ref
Get the HEAD of the repo (without any opening "ref: ")

return: string|bool The HEAD (git reference or SHA1) or false

getHeadSHA1()   X-Ref
Get the SHA1 for the current HEAD of the repo

return: string|bool A SHA1 or false

getHeadCommitDate()   X-Ref
Get the commit date of HEAD entry of the git code repository

return: int|bool Commit date (UNIX timestamp) or false

getCurrentBranch()   X-Ref
Get the name of the current branch, or HEAD if not found

return: string|bool The branch name, HEAD, or false

getHeadViewUrl()   X-Ref
Get an URL to a web viewer link to the HEAD revision.

return: string|bool String if a URL is available or false otherwise

getRemoteUrl()   X-Ref
Get the URL of the remote origin.

return: string|bool String if a URL is available or false otherwise.

cacheIsComplete()   X-Ref
Check to see if the current cache is fully populated.

Note: This method is public only to make unit testing easier. There's
really no strong reason that anything other than a test should want to
call this method.

return: bool True if all expected cache keys exist, false otherwise

precomputeValues()   X-Ref
Precompute and cache git information.

Creates a JSON file in the cache directory associated with this
GitInfo instance. This cache file will be used by subsequent GitInfo objects referencing
the same directory to avoid needing to examine the .git directory again.


headSHA1()   X-Ref

return: string

currentBranch()   X-Ref

return: string

headViewUrl()   X-Ref

return: bool|string

getViewers()   X-Ref
Gets the list of repository viewers

return: array



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1