PHP Class Gitamin\Services\Git\Util

Afficher le fichier Open project: gitaminhq/gitamin

Protected Properties

Свойство Type Description
$binaryTypes
$defaultFileTypes

Méthodes publiques

Méthode Description
extractRef ( GitList\Git\Repository $repository, string $branch = '', string $tree = '' ) : array Returns an Array where the first value is the tree-ish and the second is the path.
getBreadcrumbs ( string $spec ) : array Builds a breadcrumb array based on a path spec.
getFileType ( string $file ) : mixed Returns the file type based on filename by treating the extension.
getReadme ( $repository, $branch = null, $path = '' )
isBinary ( string $file ) : boolean Returns whether the file is binary.

Method Details

extractRef() public méthode

Returns an Array where the first value is the tree-ish and the second is the path.
public extractRef ( GitList\Git\Repository $repository, string $branch = '', string $tree = '' ) : array
$repository GitList\Git\Repository
$branch string
$tree string
Résultat array

getBreadcrumbs() public méthode

Builds a breadcrumb array based on a path spec.
public getBreadcrumbs ( string $spec ) : array
$spec string Path spec
Résultat array Array with parts of the breadcrumb

getFileType() public méthode

The file type is used by CodeMirror, a Javascript-based IDE implemented in GitList, to properly highlight the blob syntax (if it's a source-code)
public getFileType ( string $file ) : mixed
$file string File name
Résultat mixed File type

getReadme() public méthode

public getReadme ( $repository, $branch = null, $path = '' )

isBinary() public méthode

Returns whether the file is binary.
public isBinary ( string $file ) : boolean
$file string
Résultat boolean

Property Details

$binaryTypes protected_oe static_oe property

protected static $binaryTypes

$defaultFileTypes protected_oe property

protected $defaultFileTypes