\TransvisionVersionControl

VersionControl class

This class is for all the methods we need to relate to our VCS

Summary

Methods
Properties
Constants
getVCS()
VCSRepoName()
getPath()
hgPath()
gitPath()
extractFilePath()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getVCS()

getVCS(string  $repo) : string

Get the right VCS for a given repository

Parameters

string $repo

repository name

Returns

string —

Name of the VCS or false if the repo does not exist

VCSRepoName()

VCSRepoName(string  $repo) : string

Get the repo name used for VCS from the folder name used in Transvision

Parameters

string $repo

repository name

Returns

string —

Name of the VCS or unchanged $repo by default

getPath()

getPath(string  $locale, string  $repo, string  $path) : string

Generate a path to the repo for the file, depending on the VCS used by this repo

Parameters

string $locale

Locale code

string $repo

Repository name

string $path

Entity name representing the local file

Returns

string —

Path to the file in remote repository

hgPath()

hgPath(string  $locale, string  $repo, string  $path) : string

Generate a path to the mercurial repo for the file

Parameters

string $locale

Locale code

string $repo

Repository name

string $path

Entity name representing the local file

Returns

string —

Path to the file in remote mercurial repository

gitPath()

gitPath(string  $locale, string  $repo, string  $path) : string

Generate a path to the GitHub repo for the file.

Only mozilla.org is supported for now.

Parameters

string $locale

Locale code

string $repo

Repository name

string $path

Entity name representing the local file

Returns

string —

Path to the file in remote GitHub repository

extractFilePath()

extractFilePath(string  $path) : string

Remove entity and project name from path (project/file:entity)

Parameters

string $path

A Transvision file path

Returns

string —

The same path without the entity and internal project name