class FilesystemEntity (View source)

An entity on the filesystem, used as a base class for Webroot and SSPakFile

Properties

protected $server
protected $path
protected $executor
protected $identity

Methods

public
__construct($path, $executor)

No description

public
isLocal()

No description

public
getPath()

No description

public
getServer()

No description

public
setSSHItentityFile($filename)

No description

public
exec(string $command, $options = array())

Execute a command on the relevant server

public
createProcess(string $command, $options = array())

Create a process for later exection

public
upload($source, string $dest)

Upload a file to the given destination on the server

public
uploadContent(string $content, string $dest)

Create a file with the given content at the given destination on the server

public
download(string $source, string $dest)

Download a file from the given source on the server to the given file

public
bool
exists(string $file = null)

Returns true if the given file or directory exists

public
writeFile($file, $content)

Create the given file with the given content

public
unlink(string $file)

Remove a file or folder from the webroot's server

Details

__construct($path, $executor)

No description

Parameters

$path
$executor

isLocal()

No description

getPath()

No description

getServer()

No description

setSSHItentityFile($filename)

No description

Parameters

$filename

exec(string $command, $options = array())

Execute a command on the relevant server

Parameters

string $command

Shell command, either a fully escaped string or an array

$options

Process createProcess(string $command, $options = array())

Create a process for later exection

Parameters

string $command

Shell command, either a fully escaped string or an array

$options

Return Value

Process

upload($source, string $dest)

Upload a file to the given destination on the server

Parameters

$source
string $dest

The remote filename/dir to upload to

uploadContent(string $content, string $dest)

Create a file with the given content at the given destination on the server

Parameters

string $content

The content of the file

string $dest

The remote filename/dir to upload to

download(string $source, string $dest)

Download a file from the given source on the server to the given file

Parameters

string $source

The remote filename to download

string $dest

The local filename/dir to download to

bool exists(string $file = null)

Returns true if the given file or directory exists

Parameters

string $file

The file/dir to look for

Return Value

bool

writeFile($file, $content)

Create the given file with the given content

Parameters

$file
$content

Remove a file or folder from the webroot's server

Parameters

string $file

The file to remove