\FAAGit

Summary

Methods
Properties
Constants
MkFolder()
CopyFile()
CopyFolder()
FileExists()
ClassExists()
ReadFixedColumnFile()
ReadCsv()
WriteCsv()
Unzip()
Zip()
TailLogfile()
SubstringAfter()
GetLock()
SelfLockedOrOpen()
TryUnLock()
TryGetLock()
RevokeLock()
ExtractExtension()
StripQueryAndAnchor()
ExtractFileName()
ExtractFolderName()
ExtractFolder()
MemoryBytesReadable()
GzCompressFile()
DecodeJsonFile()
DecodeJson()
ArrayToObject()
EncodeJson()
StoreEncodedJson()
DeleteFile()
Chmod()
WriteFile()
GetClassNames()
ListIdFiles()
MimeType()
ListFolders()
ReadFolder()
ListFiles()
Debug()
Warn()
Log()
SysLog()
DropFolder()
FilterFolderFilesByModificationTime()
ConfigGetPreset()
VersionStringToNumber()
CallExecutable()
GetMountedHardDrives()
CollatorExists()
GetSortKey()
CalculateFolderSize()
IsBase64()
__construct()
GetCreationTime()
GetLastRecentHashes()
GetLastRecentHash()
ResolveChain()
FileRefParse()
FileRefLog()
Version()
Pull()
Branch()
CreateBranch()
Push()
GetConfigOption()
RemoteReachable()
CleanFolder()
StageFolder()
DeleteFolder()
StageFile()
ListNotPushedCommits()
CommitFile()
CommitFiles()
AddTag()
CommitAll()
AddUntracked()
GetHistoryCache()
DeleteHistoryCache()
SetHistoryCache()
AllKnownFiles()
DiffChangedFiles()
HasChanges()
ListChangedFiles()
GetLatestTag()
GetLatestCommit()
VersionTagList()
OpenCommit()
PrintObject()
ObjectType()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
DropFolderRecurse()
Encrypt()
Decrypt()
CalculateFolderSizeRecurse()
callGitExecutable()
$log_template
$file_count
$directory_count
$size
$affected
$classes
$size_unit
$collator
$folder
$default_hash
$history_file
N/A

Properties

$log_template

$log_template : string

The template for log messages in ::Log()

Type

string — The template

$file_count

$file_count : integer

File counter used in dir size recursion counter method

Type

integer — The buffer

$directory_count

$directory_count : integer

Dir counter used in dir size recursion counter method

Type

integer — The buffer

$size

$size : integer

Size counter used in dir size recursion counter method

Type

integer — The buffer

$affected

$affected : array

List of affected files and directories in recursion

Type

array — The list of paths

$classes

$classes : array

Buffer for class exists tests

Type

array — The status of the classes

$size_unit

$size_unit : array

Available file size short codes

Type

array — Used in the readable form

$collator

$collator : integer

Cache if collators are available

Type

integer — Initial set to -1

$folder

$folder : 

Type

$default_hash

$default_hash : 

Type

$history_file

$history_file : 

Type

Methods

MkFolder()

MkFolder(string  $root, array  $components, boolean  $make = true) : string|boolean

Create folder path

When the make argument set to true this function will try create the folder Return the folder components without root part

Parameters

string $root

The path to the base folder

array $components

The list of folder components

boolean $make

Try to create the folder

Returns

string|boolean —

The combined relative path as string

CopyFile()

CopyFile(string  $source, string  $target) : \FAA\Obj\Result

Copy file Copy a single file with obtaining lock on index before

Parameters

string $source

Absolute path to source

string $target

Absolute path to target

Returns

\FAA\Obj\Result

A system result object

CopyFolder()

CopyFolder(string  $source, string  $target) : \FAA\Obj\Result

Copy folder This method copies the source folder to the target folder path. The folder itself is not coiped but all of its contents.

This method creates the target folder f it is not present.

Parameters

string $source

The source folder destination

string $target

The target folder name

Returns

\FAA\Obj\Result

A system result object

FileExists()

FileExists(string  $fileName, boolean  $caseSensitive = true) : boolean

Check if file exists

Does check if a file is existing, will also check if the file exists as lower case by glob as fallback.

Parameters

string $fileName

The path to the file

boolean $caseSensitive

Use case sensitive path, defaults to true

Returns

boolean —

File exists

ClassExists()

ClassExists(string  $className) : boolean

Class exists

A cached version of class exists to prevent autoloader from starting

Parameters

string $className

The name of the calss

Returns

boolean —

Status is existing

ReadFixedColumnFile()

ReadFixedColumnFile(string  $path, integer  $length = 10000) : \FAA\Obj\Result

Read file with fixed column width

Automatic file parser based on the heads and assuming a " " space is used to make the cols equal

Parameters

string $path

Absolute link to the file to open

integer $length

Limiter for line length

Returns

\FAA\Obj\Result

A system result object

ReadCsv()

ReadCsv(string  $path, string  $delimiter = ';', string  $enclosure = "'", integer  $length = 100000, string  $escape = "\\", boolean  $check_head = true) : \FAA\Obj\Result

Read a CSV file to local storage

Fetch the file and add it to a local result object file is parsed with php function to get csv from file, arguments of this methods align with official one

Parameters

string $path

The absolute path to file to open

string $delimiter

Have a look at http://php.net/manual/de/function.fgetcsv.php delimiter

string $enclosure

Have a look at http://php.net/manual/de/function.fgetcsv.php enclosure

integer $length

Have a look at http://php.net/manual/de/function.fgetcsv.php length

string $escape

Have a look at http://php.net/manual/de/function.fgetcsv.php escape

boolean $check_head

When set, check the first line as head and validate following line lengths

Returns

\FAA\Obj\Result

A system result object

WriteCsv()

WriteCsv(string  $path, array  $list, string  $delimiter = ';', string  $enclosure = "'", string  $escape = "\\") : \FAA\Obj\Result

Write a array of entries to csv file

Parameters

string $path

The absolute path to file to open

array $list

The source to write

string $delimiter

Have a look at http://php.net/manual/de/function.fgetcsv.php delimiter

string $enclosure

Have a look at http://php.net/manual/de/function.fgetcsv.php enclosure

string $escape

Have a look at http://php.net/manual/de/function.fgetcsv.php escape

Returns

\FAA\Obj\Result

The write result

Unzip()

Unzip(string  $file, string  $target = null) : \FAA\Obj\Result

Unzip a file

Take the archive, unzip it and place the results in the defined folder or an automated one

Parameters

string $file

Absolute path to file

string $target

The output folder or, null for dynamic one

Returns

\FAA\Obj\Result

The unzip result

Zip()

Zip(string  $source, string  $target) : \FAA\Obj\Result

Create a zip archive from folder or file contents

Parameters

string $source
string $target

Returns

\FAA\Obj\Result

TailLogfile()

TailLogfile(string  $path, integer  $max = 200, integer  $buffer = 4096) : \FAA\Obj\Result

tail a log file get set of lines inside a logfile

Parameters

string $path

The target log file path

integer $max

Maximum buffer length of array

integer $buffer

Maximum buffer length of line characters

Returns

\FAA\Obj\Result

A default system result object

SubstringAfter()

SubstringAfter(  $string,   $needle,   $offset) 

Parameters

$string
$needle
$offset

GetLock()

GetLock() : \FAA\Obj\Result

obtain lock try to obtain the lock indicated by lock file in var

Returns

\FAA\Obj\Result

A default system result object

SelfLockedOrOpen()

SelfLockedOrOpen(  $pid,   $path = null) 

Parameters

$pid
$path

TryUnLock()

TryUnLock(integer  $pid, string  $path = null) : boolean

obtain lock with retry try to obtain the lock indicated by lock file in var

Parameters

integer $pid

Additional lock level reliability with process id

string $path

Path to lock file to obtain lock at

Returns

boolean —

A default system result object

TryGetLock()

TryGetLock(string  $path = null, integer  $try_count = FAA_WRITE_RETRY, float  $seconds = 0.25, integer  $pid) : boolean

obtain lock with retry try to obtain the lock indicated by lock file in var

Parameters

string $path

Path to lock file to obtain lock at

integer $try_count

Number of retry runs

float $seconds

Seconds to wait per run

integer $pid

Additional lock level reliability with process id

Returns

boolean —

True on successful lock otherwise false

RevokeLock()

RevokeLock() : \FAA\Obj\Result

release lock try to release the lock indicated by lock file in var

Returns

\FAA\Obj\Result

A default system result object

ExtractExtension()

ExtractExtension(string  $path) : string

Extract file extension

May return false if no extension could be found

Parameters

string $path

A complete file path

Returns

string —

The file extension

StripQueryAndAnchor()

StripQueryAndAnchor(string  $path) : string

Extract file name

Parameters

string $path

A complete file path

Returns

string —

The file name without additional parts

ExtractFileName()

ExtractFileName(string  $path) : string

Extract file name

Parameters

string $path

A complete file path

Returns

string —

The file name

ExtractFolderName()

ExtractFolderName(string  $path) : string

Extract folder name from root

Parameters

string $path

A complete file path

Returns

string —

The file root folder

ExtractFolder()

ExtractFolder(string  $path) : string

Extract folder path from root

Parameters

string $path

A complete file path

Returns

string —

The file root folder

MemoryBytesReadable()

MemoryBytesReadable(integer  $size) : string

Memory readable Convert size of bytes in human readable units

Parameters

integer $size

The size in bytes

Returns

string —

The calculated size

GzCompressFile()

GzCompressFile(string  $source, integer  $level = 9, boolean  $clean = true) : \FAA\Obj\Result

GZIPs a file on disk (appending .gz to the name)

From http://stackoverflow.com/questions/6073397/how-do-you-create-a-gz-file-using-php Based on function by Kioob at: http://www.php.net/manual/en/function.gzwrite.php#34955

Parameters

string $source

Path to file that should be compressed

integer $level

GZIP compression level (default: 9)

boolean $clean

Clean source file after compression (default: true)

Returns

\FAA\Obj\Result

A default system result object

DecodeJsonFile()

DecodeJsonFile(string  $path,   $mode = true,   $crypt = false) : \FAA\Obj\Result

parse json from file to object or assoc use the json parse to fetch text data from a given path and return it as object with assoc or object payload

Parameters

string $path

The absolute path to a certain storage file

$mode

(boolean) Parse as assoc or object, default assoc

$crypt

(boolean) Decrypt string before parsing

Returns

\FAA\Obj\Result

A default system result object

DecodeJson()

DecodeJson(string  $data, boolean  $mode = true, boolean|string  $crypt = false) : \FAA\Obj\Result

Parse json from string to object or assoc

Use the json parse function to decode a string to assoc or object It will use the given code in crypt to decrypt or fall back to system key

Parameters

string $data

The payload to decode

boolean $mode

Parse as assoc or object, default is true and therefor assoc array

boolean|string $crypt

Decrypt string before parsing

Returns

\FAA\Obj\Result

A default system result object

ArrayToObject()

ArrayToObject(array  $array) : \stdClass

Convert array to object

Convert the given array element to object, using the json methods

Parameters

array $array

The input values to convert

Returns

\stdClass —

The converted element as object

EncodeJson()

EncodeJson(mixed  $data, integer  $mode = JSON_PRETTY_PRINT, boolean  $crypt = false) : \FAA\Obj\Result

Serialize a given input to json representation use the json parse function to decode an assoc or object

Parameters

mixed $data

The payload to encode

integer $mode

Serialize readable or unformatted

boolean $crypt

Encrypt the result after serialisation

Returns

\FAA\Obj\Result

A default system result object

StoreEncodedJson()

StoreEncodedJson(string  $path, mixed  $data, integer  $mode = JSON_PRETTY_PRINT, boolean  $crypt = false) : \FAA\Obj\Result

serialize a given input use the json parse function to create json representation and store it in a certain file this method does a encryption also on demand

Parameters

string $path

The target file path

mixed $data

The payload to encode

integer $mode

Serialize readable or not formatted

boolean $crypt

Encrypt the result after serialisation

Returns

\FAA\Obj\Result

A default system result object

DeleteFile()

DeleteFile(string  $path) : boolean

Deletes single file This method deletes a single file, it will wait when the system is in git lock mode

Parameters

string $path

The target file path

Returns

boolean —

True on success otherwise false

Chmod()

Chmod(  $file,   $octal) : boolean

Chamge the permissions

Parameters

$file
$octal

Returns

boolean

WriteFile()

WriteFile(string  $path, string  $data, integer  $flags) : boolean

Write string to file This method writes the given data to the defined file, it will wait when the system is in git lock mode.

This method returns valid result also for writing empty strings unlike file put contents default behavior

Parameters

string $path

The target file path

string $data

The payload to store in the target file

integer $flags

File put content flags (http://php.net/manual/de/function.file-put-contents.php)

Returns

boolean —

True on success otherwise false

GetClassNames()

GetClassNames(array  $paths) : array

List classes in folder Fetch a list of classes inside the folder

Parameters

array $paths

List of paths to search

Returns

array —

A list of class names found in the folder

ListIdFiles()

ListIdFiles(string  $dir, string  $ext = 'json', boolean  $to_int = true) : array

find file ids find a list of file ids inside a folder and its sub directories

Parameters

string $dir

The root folder path to search in

string $ext

Filter by extension

boolean $to_int

Convert to integer when set to true

Returns

array —

A list containing the found id's

MimeType()

MimeType(string  $file) : string

Get mime type of file

Parameters

string $file

The absolute file path

Returns

string —

The mime type of the file

ListFolders()

ListFolders(string  $path) : array

List folder names in certain root folder

Parameters

string $path

The absolute path to the folder

Returns

array

ReadFolder()

ReadFolder(string  $dir) : array<mixed,\FAA\Obj\Sys\File>

Read folder

Will list all files and folders of a folder

Parameters

string $dir

Path to root folder

Returns

array<mixed,\FAA\Obj\Sys\File> —

An array of file objects

ListFiles()

ListFiles(string  $dir, string  $ext = '/^json$/', boolean  $full = false) : array

list files Iterate over directory and list the found files

Parameters

string $dir

The root folder path to search in

string $ext

Filter by extension (can be empty, a string or a regex)

boolean $full

Check the full name of the file or just the extension when false

Returns

array —

A list containing the found files

Debug()

Debug(  $object) 

log debug object writs a formatted log message including back trace to the global log file

Parameters

$object

(mixed) The object to be logged

Warn()

Warn(  $object) 

log warn object writs a formatted log message including back trace to the global log file

Parameters

$object

(mixed) The object to be logged

Log()

Log(mixed  $object, string  $msg = null) 

log object writs a formatted log message including back trace to the global log file

Parameters

mixed $object

The object to be logged

string $msg

Additional message

SysLog()

SysLog(string  $level, mixed  $object) : boolean

log message writs a formatted log message including back trace to the global log file

Parameters

string $level

Name of the log level

mixed $object

The object to be logged

Returns

boolean —

Status if write to log worked

DropFolder()

DropFolder(string  $folder, boolean  $full = false) : array

Delete a full folder this method clears or delete a folder recursively, side effect will fill list of delete folders and files

Parameters

string $folder

The path to delete

boolean $full

Also remove the root folder

Returns

array —

List of deleted folders and files

FilterFolderFilesByModificationTime()

FilterFolderFilesByModificationTime(string  $root, integer  $timestamp, boolean  $older = true) : \FAA\Obj\Result

Get a list of files that are either older or newer a certain time point

Parameters

string $root

The start point for the recursion

integer $timestamp

The time point to flip

boolean $older

When true result list files are older than the time stamp otherwise newer

Returns

\FAA\Obj\Result

A system result object containing the files

ConfigGetPreset()

ConfigGetPreset(string  $name) : \FAA\Obj\Result

Load a config preset

Fetch a preset from default system storage location and return it decoded

Parameters

string $name

The preset name

Returns

\FAA\Obj\Result

A system result object

VersionStringToNumber()

VersionStringToNumber(string  $number, string  $regex = '/[^0-9\.]/i', string  $replace = '', integer  $pads = 4) : string

Convert version number Converts the given number to a unified string e.g. 'v1.234.33' will become 102340033

Parameters

string $number

The version number to calculate

string $regex

Replacement expression to clear the number upfront

string $replace

Replacement string for regex_replace

integer $pads

Add this amount of zeros to the left

Returns

string —

The cleared version number

CallExecutable()

CallExecutable(string  $cmd, string  $folder, string  $outfile = '') : \FAA\Obj\Result

Execute a system command Uses installed executable to perform a system call

Parameters

string $cmd

The command to execute

string $folder

The working directory

string $outfile

Optional output file of the call result

Returns

\FAA\Obj\Result

A system result object

GetMountedHardDrives()

GetMountedHardDrives() : \FAA\Obj\Result

list available disk space use system commands to retrieve disk informations, this method is partial cached On windows we use fsutil on *nix we use df -h

Returns

\FAA\Obj\Result

A default system result object

CollatorExists()

CollatorExists() : boolean

Check if collators available Test if the ICU collator functions ae available. This function is cached.

Returns

boolean —

True when collator is available

GetSortKey()

GetSortKey(string  $text, string  $collation = FAA_LOCALE, boolean  $encode = false) : \FAA\Obj\Result

Calculate the sort key Using the ICU collator to create a sort key representation of the given string.

Parameters

string $text

The text to convert to sort key

string $collation

The collation to use for convert e.g. en_US or, de

boolean $encode

When set to true, convert the sort key to urlencoded representation

Returns

\FAA\Obj\Result

A default system result object

CalculateFolderSize()

CalculateFolderSize(string  $folder) : array

calculate size of a specific folder use a recursive working function to calculate a folder size

Parameters

string $folder

The path to calculate the size of

Returns

array —

A assoc structure holding the folder information

IsBase64()

IsBase64(string  $string, boolean  $simple = true) : boolean

guess if string is base64 will try to guess if the given string is base64

Parameters

string $string

The string to check

boolean $simple

Use a simple method to check the given content

Returns

boolean —

True on success otherwise false

__construct()

__construct(string  $folder) 

construct new instance Open new repository instance

Parameters

string $folder

The absolute path to the repository to open

GetCreationTime()

GetCreationTime(string  $path) : \FAA\Obj\Result

Get the creation tim of a file will try to use index, but when file not indexed a atime call is done

Parameters

string $path

The relative path to the file to check

Returns

\FAA\Obj\Result

A default system result object

GetLastRecentHashes()

GetLastRecentHashes(string  $path = '', integer  $count = 1000) : \FAA\Obj\Result

get commit list that affected a file loads the id list of the commits that affected a file

Parameters

string $path

The relative path to the file to check or null for whole repository

integer $count

The maximum length of history lines to return

Returns

\FAA\Obj\Result

A default system result object

GetLastRecentHash()

GetLastRecentHash(string  $path = '') : \FAA\Obj\Result

get the last commit that affected a file loads the id of the last commit or the default value when file is not known to git

Parameters

string $path

The relative path to the file to check or null for whole repository

Returns

\FAA\Obj\Result

A default system result object

ResolveChain()

ResolveChain(string  $ref) : array<mixed,\FAA\Obj\Git\Commit>

Get list of all parental commits based on a certain reference

Parameters

string $ref

The start point

Returns

array<mixed,\FAA\Obj\Git\Commit> —

The list of found commits

FileRefParse()

FileRefParse(string  $hash, string  $path) : \FAA\Obj\Result

get the values of version of a certain file loads the file content at a certain version

Parameters

string $hash

The GIT commit hash to load at

string $path

The relative path to the file to check

Returns

\FAA\Obj\Result

A default system result object

FileRefLog()

FileRefLog(string  $path) : \FAA\Obj\Result

get the version list of a certain file loads the list of commits that affected a certain file

Parameters

string $path

The relative path to the file to check

Returns

\FAA\Obj\Result

A default system result object

Version()

Version() : \FAA\Obj\Result

get the version of git executable loads the version string

Returns

\FAA\Obj\Result

A default system result object

Pull()

Pull(\FAA\Obj\CronJob  $job = null) : \FAA\Obj\Result

pull the changes from remote load and update all commits from remote server

Parameters

\FAA\Obj\CronJob $job

When running in job context, the cronjob instance otherwise false or null

Returns

\FAA\Obj\Result

A default system result object

Branch()

Branch() : string|null

Get the current branch name

Returns

string|null

CreateBranch()

CreateBranch(  $name) : \FAA\Obj\Result

Create a new branch and checkout

Parameters

$name

Returns

\FAA\Obj\Result

Push()

Push(\FAA\Obj\CronJob  $job = null, string  $args = null) : \FAA\Obj\Result

push the changes to remote push all outgoing commits to remote server

Parameters

\FAA\Obj\CronJob $job

When running in job context, the cronjob instance otherwise false or null

string $args

Additional command line arguments

Returns

\FAA\Obj\Result

A default system result object

GetConfigOption()

GetConfigOption(string  $key) : \FAA\Obj\Result

get a config option use git config to load a certain option

Parameters

string $key

The option to load

Returns

\FAA\Obj\Result

A default system result object

RemoteReachable()

RemoteReachable() : \FAA\Obj\Result

check if server is reachable does a ping to the storage server using ls remote

Returns

\FAA\Obj\Result

a default system result object

CleanFolder()

CleanFolder(string  $folder) : \FAA\Obj\Result

remove all unstaged changes from local database will do a git clean -df on the given folder

Parameters

string $folder

Relative path to stage target

Returns

\FAA\Obj\Result

A default system result object

StageFolder()

StageFolder(string  $folder) : \FAA\Obj\Result

stage changes into local database will do a git add -u on the given folder

Parameters

string $folder

Relative path to stage target

Returns

\FAA\Obj\Result

A default system result object

DeleteFolder()

DeleteFolder(string  $folder) : \FAA\Obj\Result

stage changes into local database will do a git add -u on the given folder

Parameters

string $folder

Relative path to stage target

Returns

\FAA\Obj\Result

A default system result object

StageFile()

StageFile(string  $file, boolean  $rm = false) : \FAA\Obj\Result

Stage changes into local database

Can either remove or add changed files to index. Files to add need to be existing Files to remove have to be deleted before from file system

Parameters

string $file

Relative path to stage target

boolean $rm

When true, delete from index

Returns

\FAA\Obj\Result

A system result object

ListNotPushedCommits()

ListNotPushedCommits(string  $branch = 'master') : \FAA\Obj\Result

List not pushed commits

The list will contain values like this if there are not pushed commits to the given branch 60f2a80b58c19183c73d1189e26baee22715170c [Wed, 22 Aug 2018 11:37:36 +0200] CHG: Make sure to amend only when commits are not pushed yet bfd98c345a6ebb345965c2451b32b785e0bc60c3 [Wed, 22 Aug 2018 11:23:44 +0200] ADD: Integrate solution to do something

Parameters

string $branch

Returns

\FAA\Obj\Result

CommitFile()

CommitFile(string  $file, string  $msg, boolean  $amend = false) : \FAA\Obj\Result

Commit a single file

Adds the given file and commits it with the given message. The amend function will only work if at least one local commit is remaining.

Parameters

string $file

The relative file path

string $msg

The commit message

boolean $amend

When true the commit will be added to the last unpushed commit

Returns

\FAA\Obj\Result

A system result object

CommitFiles()

CommitFiles(array  $files, \FAA\Obj\CronJob  $job = null) : \FAA\Obj\Result

store the changed files update the git index by doing a commit

Parameters

array $files

A list of relative filepaths to commit

\FAA\Obj\CronJob $job

When running in job context, the cronjob instance otherwise false or null

Returns

\FAA\Obj\Result

A default system result object

AddTag()

AddTag(string  $name, string  $msg, string  $commit = null, boolean  $force = false) : \FAA\Obj\Result

Add a tag

Adds an tag to the current commit given the name and a message. With commit and force flag it is possible to overwrite/move tags

Parameters

string $name

The tag name e.g. v1.0.0

string $msg

The tag message

string $commit

A certain commit

boolean $force

When commit is given, and this is true it will force the tag

Returns

\FAA\Obj\Result

A system result object

CommitAll()

CommitAll(string  $msg) : \FAA\Obj\Result

Create commit over all

Create a commit with the -a option and sets the given message. Will fail when no local changes are available

Parameters

string $msg

The commit message

Returns

\FAA\Obj\Result

A system result object

AddUntracked()

AddUntracked() : \FAA\Obj\Result

add not tracked uses a git alias to add not tracked files

Returns

\FAA\Obj\Result

a default system result object

GetHistoryCache()

GetHistoryCache() : \FAA\Obj\Result

get the history file load the list of changes before last call

Returns

\FAA\Obj\Result

a default system result object

DeleteHistoryCache()

DeleteHistoryCache() 

SetHistoryCache()

SetHistoryCache(array  $data) : \FAA\Obj\Result

store the history file update the list of changes after sync call

Parameters

array $data

A list of commit hashes

Returns

\FAA\Obj\Result

A default system result object

AllKnownFiles()

AllKnownFiles() : \FAA\Obj\Result

get all files known to git load the list of files in the current index

Returns

\FAA\Obj\Result

a default system result object

DiffChangedFiles()

DiffChangedFiles(string  $hash) : \FAA\Obj\Result

list changed files provide a list of changed files of git

Parameters

string $hash

The start hash to check from

Returns

\FAA\Obj\Result

A default system result object

HasChanges()

HasChanges(null  $file = null) : \FAA\Obj\Result

Parameters

null $file

Returns

\FAA\Obj\Result

ListChangedFiles()

ListChangedFiles(boolean  $auto_add = false) : \FAA\Obj\Result

list changed files provide a list of not tracked files of git

Parameters

boolean $auto_add

Automatic add files that are currently untracked

Returns

\FAA\Obj\Result

A default system result object

GetLatestTag()

GetLatestTag() : string

Get the latest tag of the system Uses the describe function to get the latest tag

Returns

string —

the latest version tag

GetLatestCommit()

GetLatestCommit(integer  $len = 7) : string

Get the latest commit hash of the system Uses log function to get the latest commit

Parameters

integer $len

Characters length to return from hash

Returns

string —

The latest commit

VersionTagList()

VersionTagList(string  $path = '/^tag\: v/') : \FAA\Obj\Result

Get the system version tags

Uses for-each-ref to load and parse a list of tgs to Tag objects

Parameters

string $path

The selection string of paths to search in index

Returns

\FAA\Obj\Result

A system result object

OpenCommit()

OpenCommit(string  $object_id) : \FAA\Obj\Git\Commit|null

Open the commit based on an id

Parameters

string $object_id

The git hash

Returns

\FAA\Obj\Git\Commit|null —

A commit object or null

PrintObject()

PrintObject(string  $object_id) : string|null

Parse a git object

Parameters

string $object_id

A 40 digit git object id

Returns

string|null —

The parsed result or null on error

ObjectType()

ObjectType(  $object_id) : string|null

Get type of git object

Parameters

$object_id

Returns

string|null

DropFolderRecurse()

DropFolderRecurse(string  $folder, boolean  $full = false) : boolean

delete a full folder this method is the recursion helper for DropFolder()

Parameters

string $folder

The path to delete

boolean $full

Also remove the root folder

Returns

boolean —

The delete status

Encrypt()

Encrypt(string  $encrypt, string  $mc_key = FAA_CODE) : string

encrypt data will try to encrypt the given data with the system encryption code or a customer defined one The function does a blowfish encryption and a base64 conversion

Parameters

string $encrypt

The string to encrypt

string $mc_key

The key

Returns

string —

The encrypted string base64 encoded

Decrypt()

Decrypt(string  $encrypted, string  $mc_key = FAA_CODE) : string

decrypt data will try to decrypt the given data with the system encryption code or a customer defined one The function does a blowfish decryption and a base64 conversion on demand

Parameters

string $encrypted

The string to decrypt (must be base64 encoded)

string $mc_key

The key

Returns

string —

The decrypted string

CalculateFolderSizeRecurse()

CalculateFolderSizeRecurse(string  $folder) : boolean

Helper function to calculate size Recursively calculate size of a specific folder

Parameters

string $folder

The path to calculate the size of

Returns

boolean —

The delete result status

callGitExecutable()

callGitExecutable(string  $cmd, string  $outfile = '', boolean  $lock = false) : \FAA\Obj\Result

Execute a git command

Uses installed git executable to do index operations

Parameters

string $cmd

The command to execute

string $outfile

Optional output file of the call result

boolean $lock

Optional, lock exclusive on demand

Returns

\FAA\Obj\Result

A system result object