PHP Class Gitamin\Services\Git\Util

Show file Open project: gitaminhq/gitamin

Protected Properties

Property Type Description
$binaryTypes
$defaultFileTypes

Public Methods

Method 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 method

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
return array

getBreadcrumbs() public method

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

getFileType() public method

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
return mixed File type

getReadme() public method

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

isBinary() public method

Returns whether the file is binary.
public isBinary ( string $file ) : boolean
$file string
return boolean

Property Details

$binaryTypes protected static property

protected static $binaryTypes

$defaultFileTypes protected property

protected $defaultFileTypes