Class Tlaloc_File
Tlaloc_File
public
|
#
__construct( mixed $array_Repositories = null, mixed $Agent_PrivKey = null, mixed $array_Rsync_Excludes = null )
Tlaloc_File::__construct() Instantiate a File object, make sure to supply a Repository array listing, the SSH agent's private key and optionally RSYNC Exclude clauses |
public
boolean
|
#
Run_Process( mixed $cmd, mixed $flag_WaitForCompletion = true, mixed $flag_TextualResult = false, mixed $array_ENV = null, mixed $flag_ShowOutput = false )
Tlaloc_File::Run_Process() Execute a shell command/process. We encapsulate these calls so we don't clobber code with pipes, buffering and such... TODO: make async vs sync calls (flag_WaitForCompletion) by forking or not. |
private
|
#
Merge_RSYNC_Clauses( mixed $array_Input, string $rsync_clause = "--exclude" )
Tlaloc_File::Merge_RSYNC_Clauses() Internal function used to merge rsync command line parameters |
private
string
|
|
private
string
|
#
Look_For_BestSource( mixed $Filename, $Module_Name = null, $flag_UseOsSuffix = true )
Tlaloc_File::Look_For_Source() Look for the source file in the stacked repositories, from node to defaults TODO: Make this work with other mediums than SSH, and perhaps, cache the remote listings somehow or have an agent running on the repositories (which would rule out Amazon:S3,arg) |
public
boolean
|
|
public
|
|
public
boolean
|
|
public
|
#
File_ChangeGroup( mixed $Filename, string $Group = "wheel", boolean $flag_Recursive = false )
Tlaloc_File::File_ChangeGroup() Change Group settings on a file, usually used internally, but available publicly |
public
boolean
|
#
File_Chown( mixed $Filename, string $Owner = "root", boolean $flag_Recursive = false )
Tlaloc_File::File_Chown() Chown a file resource, usually used internally, but available publicly |
public
boolean
|
#
File_SetPermissions( mixed $Filename, string $Permissions = "755", boolean $flag_Recursive = false )
Tlaloc_File::File_SetPermissions() Set File/Folder permissions, usually used internally, but available publicly |
public
|
#
SetAttributes( mixed $Filename, mixed $Permissions = null, mixed $Owner = null, mixed $Group = null, boolean $flag_Recursive = false )
Tlaloc_File::SetAttributes() Apply a set of attribute to a File/Folder object (Permissions, Owner, Group) Usually used internally, but available publicly |
public
boolean
|
|
public
boolean
|
|
public
boolean
|
#
AddLine_IfNotFound( mixed $Filename, mixed $LineToAdd, mixed $NotFound_Pattern )
Tlaloc_File::AddLine_IfNotFound() Append a line of text to a text file, given that the submitted Grep pattern is not found in the file. |
public
boolean
|
#
RemoveLine( mixed $Filename, mixed $Grep_Pattern )
Tlaloc_File::RemoveLine() Remove a line, using a grep pattern, from a file. Note that you can grep many lines ;) |
public
integer
|
|
public
boolean
|
#
Append_To_Var( mixed $Filename, mixed $Varname, mixed $Value_To_Add, mixed $Var_Style = "RC" )
Tlaloc_File::Append_To_Var() Append to a var content within a config text file. |
private
boolean
|
#
Replace_Line( mixed $Filename, mixed $Old_Line, mixed $New_Line )
Tlaloc_File::Replace_Line() Internal function used in swapping old and new text lines in config files. |
public
boolean
|
#
Remove_From_Var( mixed $Filename, mixed $Varname, mixed $Value_To_Remove, string $Var_Style = "RC" )
Tlaloc_File::Remove_From_Var() Remove a value from a var within a specified text/config file |
protected
array
|
|
public
boolean
|
#
Jail( mixed $Src_File, mixed $Destination_Root, boolean $flag_Strip_Source_Path = false, $flag_Executable = true )
Tlaloc_File::Jail() Jail a program file or a config file within a particular Destination_Root, making sure to transfer any dependencies as reported by the ldd unix utility, and creating the necessary sub-folders in the destination. |
public
array
|
$SUPPORTED_COMMANDS | array("exists"=>"Check to see if a file exists","reset"=>"Overwrite the file if it differs","write"=>"Write a file (ignoring previous one)","delete"=>"Delete a local file","install"=>"install") |
|
public
array
|
$Repos | array() |
|
private
|
$Repository_Type |
|
|
private
|
$Agent_PrivKey |
|
|
private
array
|
$RSync_Excludes | array() |
|
private
|
$RSYNC_Excludes_Str |
|
|
public
array
|
$Digest | array() |