class GitFunction

Properties

protected $repoId
protected $basePath
protected $scriptPath

Methods

__construct()

GitFunction constructor.

string
getStatus($path)

getStatus: get git status

string
doAdd($path)

doAdd: do git add

bool
addGitHooks($path, $user, $email)

addGitHooks: add the githooks folder

string
doAddFile($file, $path)

doAddFile: git add specific file

bool
isUntracked($status)

isUntracked: check if there are untracked files present

bool
isTracked($path)

isTracked: check if there are tracked files present

string|null
hasDiff($path)

hasDiff: git diff

bool
fileHasDiff($path, $file)

fileHasDiff: git check if specific file has diff

bool
fileExists($path)

fileExists

bool
isAdded($status)

isAdded: check if there are git added files

bool
isModified($status)

isModified: git check if there modified, not staged files present

bool
isModifiedAndAdded($status)

isModifiedAndAdded: git check if there modified, staged files present

bool
isCommitted($commitmessage, $logmessage)

isCommitted: git check if something is committed

bool
isReadyForPush($status)

isReadyForPush: git check if there are elements to be pushed

bool
isCleanWorkingTree($status)

isCleanWorkingTree: git check if all is committed and pushed

string
getLogMessage($nummer, $path)

getLogMessage: git fetch commit log by number

bool
addUntracked($pathWithOutAddedFolder, string $folder = "")

addUntracked: git add untracked files

bool
addModified($pathWithOutAddedFolder, string $folder = "")

addModified: git add modified files

bool
commitFiles($path, $commitmessage, $user, $email)

commitFiles: git commit files

bool
commitFile($path, $file, $commitmessage, $user, $email)

commitFile: git commit specific file

bool
setCorpusVersionTag($corpusPath, $tagmessage, $version, $user, $email, $blame)

setCorpusVersionTag: git set version tag

bool
isTagged($version, $corpusPath)

isTagged: git check if tagged by given version

bool
addRemote($origin, $path)

addRemote: git add remote repository

bool
initialPush($path, $user)

initialPush: git push initial corpusstructure

bool
resetAdd($path, $files)

resetAdd: git reset added files from the staging

bool
pushFiles($path, $corpusid)

pushFiles: git push files

pushFiles2($path, $corpusid)

No description

bool
addFileUpdate($path, $file)

addFileUpdate: git add modified files

bool
initiateRepository($path)

initiateRepository: git init

bool
copyGitHooks($path)

copyGitHooks: copy the githooks folder to the corpus

array
setGitConfig($path, $configs)

setGitConfig

bool
setCoreHooksPath($path)

setCoreHooksPath: set path of the githooks folder in git config

static 
__callStatic($name, $arguments)

No description

bool
copyScripts($path)

copyScripts: copy the pipeline python scripts to the corpus

array
writeFiles($dirPath, $fileDataArray, $flySystem, $fileTempPath, $theFilePath)

writeFiles: write uploaded files to the corpus

string
makeDirectory($path, $directory)

makeDirectory: unix mkdir

string
renameFile($path, $oldname, $newname)

renameFile: unix mv

bool
deleteFiles($path, $user, $email)

deleteFiles

deleteCorpusFiles($path, $user, $email)

No description

bool
deleteUntrackedDataFiles($path)

deleteUntrackedDataFiles: delete corpus data files that are not git staged

bool
deleteUntrackedFiles($path, bool $isProject = false, bool $isCorpus = false)

deleteUntrackedFiles: delete corpusheader files not git staged

array
getCommitData($path)

getCommitData: git show

bool
isDottedFile($file)

isDottedFile: determine if we have a .dotfile

array
getListOfStagedFiles($path)

getListOfStagedFiles: git status --porcelain

getListOfStagedFiles2($path)

No description

string|null
checkForCorpusFiles($path)

checkForCorpusFiles: execute validateHeaders.py to check if the corpus has all files present

Details

at line 30
__construct()

GitFunction constructor.

at line 44
string getStatus($path)

getStatus: get git status

Parameters

$path

Return Value

string

at line 63
string doAdd($path)

doAdd: do git add

Parameters

$path

Return Value

string

at line 94
bool addGitHooks($path, $user, $email)

addGitHooks: add the githooks folder

Parameters

$path
$user
$email

Return Value

bool

at line 121
string doAddFile($file, $path)

doAddFile: git add specific file

Parameters

$file
$path

Return Value

string

at line 141
bool isUntracked($status)

isUntracked: check if there are untracked files present

Parameters

$status

Return Value

bool

at line 153
bool isTracked($path)

isTracked: check if there are tracked files present

Parameters

$path

Return Value

bool

at line 183
string|null hasDiff($path)

hasDiff: git diff

Parameters

$path

Return Value

string|null

at line 213
bool fileHasDiff($path, $file)

fileHasDiff: git check if specific file has diff

Parameters

$path
$file

Return Value

bool

at line 241
bool fileExists($path)

fileExists

Parameters

$path

Return Value

bool

at line 252
bool isAdded($status)

isAdded: check if there are git added files

Parameters

$status

Return Value

bool

at line 264
bool isModified($status)

isModified: git check if there modified, not staged files present

Parameters

$status

Return Value

bool

at line 276
bool isModifiedAndAdded($status)

isModifiedAndAdded: git check if there modified, staged files present

Parameters

$status

Return Value

bool

at line 289
bool isCommitted($commitmessage, $logmessage)

isCommitted: git check if something is committed

Parameters

$commitmessage
$logmessage

Return Value

bool

at line 301
bool isReadyForPush($status)

isReadyForPush: git check if there are elements to be pushed

Parameters

$status

Return Value

bool

at line 313
bool isCleanWorkingTree($status)

isCleanWorkingTree: git check if all is committed and pushed

Parameters

$status

Return Value

bool

at line 326
string getLogMessage($nummer, $path)

getLogMessage: git fetch commit log by number

Parameters

$nummer
$path

Return Value

string

at line 350
bool addUntracked($pathWithOutAddedFolder, string $folder = "")

addUntracked: git add untracked files

Parameters

$pathWithOutAddedFolder
string $folder

Return Value

bool

at line 390
bool addModified($pathWithOutAddedFolder, string $folder = "")

addModified: git add modified files

Parameters

$pathWithOutAddedFolder
string $folder

Return Value

bool

at line 419
bool commitFiles($path, $commitmessage, $user, $email)

commitFiles: git commit files

Parameters

$path
$commitmessage
$user
$email

Return Value

bool

at line 455
bool commitFile($path, $file, $commitmessage, $user, $email)

commitFile: git commit specific file

Parameters

$path
$file
$commitmessage
$user
$email

Return Value

bool

at line 502
bool setCorpusVersionTag($corpusPath, $tagmessage, $version, $user, $email, $blame)

setCorpusVersionTag: git set version tag

Parameters

$corpusPath
$tagmessage
$version
$user
$email
$blame

Return Value

bool

at line 548
bool isTagged($version, $corpusPath)

isTagged: git check if tagged by given version

Parameters

$version
$corpusPath

Return Value

bool

at line 577
bool addRemote($origin, $path)

addRemote: git add remote repository

Parameters

$origin
$path

Return Value

bool

at line 631
bool initialPush($path, $user)

initialPush: git push initial corpusstructure

Parameters

$path
$user

Return Value

bool

at line 672
bool resetAdd($path, $files)

resetAdd: git reset added files from the staging

Parameters

$path
$files

Return Value

bool

at line 708
bool pushFiles($path, $corpusid)

pushFiles: git push files

Parameters

$path
$corpusid

Return Value

bool

at line 731
pushFiles2($path, $corpusid)

Parameters

$path
$corpusid

at line 757
bool addFileUpdate($path, $file)

addFileUpdate: git add modified files

Parameters

$path
$file

Return Value

bool

at line 779
bool initiateRepository($path)

initiateRepository: git init

Parameters

$path

Return Value

bool

at line 809
bool copyGitHooks($path)

copyGitHooks: copy the githooks folder to the corpus

Parameters

$path

Return Value

bool

at line 837
array setGitConfig($path, $configs)

setGitConfig

Parameters

$path
$configs

Return Value

array

at line 862
bool setCoreHooksPath($path)

setCoreHooksPath: set path of the githooks folder in git config

Parameters

$path

Return Value

bool

at line 882
static __callStatic($name, $arguments)

Parameters

$name
$arguments

at line 895
bool copyScripts($path)

copyScripts: copy the pipeline python scripts to the corpus

Parameters

$path

Return Value

bool

at line 930
array writeFiles($dirPath, $fileDataArray, $flySystem, $fileTempPath, $theFilePath)

writeFiles: write uploaded files to the corpus

Parameters

$dirPath
$fileDataArray
$flySystem
$fileTempPath
$theFilePath

Return Value

array

at line 1029
string makeDirectory($path, $directory)

makeDirectory: unix mkdir

Parameters

$path
$directory

Return Value

string

at line 1052
string renameFile($path, $oldname, $newname)

renameFile: unix mv

Parameters

$path
$oldname
$newname

Return Value

string

at line 1075
bool deleteFiles($path, $user, $email)

deleteFiles

Parameters

$path
$user
$email

Return Value

bool

at line 1145
deleteCorpusFiles($path, $user, $email)

Parameters

$path
$user
$email

at line 1197
bool deleteUntrackedDataFiles($path)

deleteUntrackedDataFiles: delete corpus data files that are not git staged

Parameters

$path

Return Value

bool

at line 1247
bool deleteUntrackedFiles($path, bool $isProject = false, bool $isCorpus = false)

deleteUntrackedFiles: delete corpusheader files not git staged

Parameters

$path
bool $isProject
bool $isCorpus

Return Value

bool

at line 1339
array getCommitData($path)

getCommitData: git show

Parameters

$path

Return Value

array

at line 1380
bool isDottedFile($file)

isDottedFile: determine if we have a .dotfile

Parameters

$file

Return Value

bool

at line 1393
array getListOfStagedFiles($path)

getListOfStagedFiles: git status --porcelain

Parameters

$path

Return Value

array

at line 1410
getListOfStagedFiles2($path)

Parameters

$path

at line 1435
string|null checkForCorpusFiles($path)

checkForCorpusFiles: execute validateHeaders.py to check if the corpus has all files present

Parameters

$path

Return Value

string|null