class SSPakFile extends FilesystemEntity (View source)

Properties

protected $server from  FilesystemEntity
protected $path from  FilesystemEntity
protected $executor from  FilesystemEntity
protected $identity from  FilesystemEntity
protected $phar
protected $pharAlias
protected $pharPath

Methods

public
__construct($path, $executor, $pharAlias = 'sspak.phar')

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(string $filename, $content)

Create a file in the .sspak with the given content

public
unlink(string $file)

Remove a file or folder from the webroot's server

public
getPhar()

No description

public
makeExecutable()

Add the SSPak executable information into this SSPak file

public
bool
contains(string $file)

Returns true if this sspak file contains the given file.

public
content($file)

Returns the content of a file from this sspak

public
null
writeFileFromProcess(string $filename, Process $process)

Pipe the output of the given process into a file within this SSPak

public
Stream
writeStreamForFile(string $filename)

Return a writeable stream corresponding to the given file within the .sspak

public
Stream
readStreamForFile(string $filename)

Return a readable stream corresponding to the given file within the .sspak

public
gitRemoteDetails()

Extracts the git remote details and reutrns them as a map

Details

__construct($path, $executor, $pharAlias = 'sspak.phar')

No description

Parameters

$path
$executor
$pharAlias

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(string $filename, $content)

Create a file in the .sspak with the given content

Parameters

string $filename

The name of the file within the .sspak

$content

Remove a file or folder from the webroot's server

Parameters

string $file

The file to remove

getPhar()

No description

makeExecutable()

Add the SSPak executable information into this SSPak file

bool contains(string $file)

Returns true if this sspak file contains the given file.

Parameters

string $file

The filename to look for

Return Value

bool

content($file)

Returns the content of a file from this sspak

Parameters

$file

null writeFileFromProcess(string $filename, Process $process)

Pipe the output of the given process into a file within this SSPak

Parameters

string $filename

The file to create within the SSPak

Process $process

The process to execute and take the output from

Return Value

null

Stream writeStreamForFile(string $filename)

Return a writeable stream corresponding to the given file within the .sspak

Parameters

string $filename

The name of the file within the .sspak

Return Value

Stream context

Stream readStreamForFile(string $filename)

Return a readable stream corresponding to the given file within the .sspak

Parameters

string $filename

The name of the file within the .sspak

Return Value

Stream context

gitRemoteDetails()

Extracts the git remote details and reutrns them as a map