class Webroot extends FilesystemEntity (View source)

Represents one webroot, local or remote, that sspak interacts with

Properties

protected $server from  FilesystemEntity
protected $path from  FilesystemEntity
protected $executor from  FilesystemEntity
protected $identity from  FilesystemEntity
protected $sudo
protected $details

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

public
setSudo($sudo)

No description

public
details()

Return a map of the db & asset config details.

public
sniff()

Return a map of the db & asset config details, acquired with ssnap-sniffer

public
array
execSudo(string|array $command, $options = array())

Execute a command on the relevant server, using the given sudo option

public
putdb($sspak, bool $dropdb)

Put the database from the given sspak file into this webroot.

public
putdb_MySQLPDODatabase($conf, $sspak, $dropdb)

No description

public
putdb_MySQLDatabase($conf, $sspak, $dropdb)

No description

public
putdb_PostgreSQLDatabase($conf, $sspak, $dropdb)

No description

public
putassets($sspak)

No description

public
putgit(array $details)

Load a git remote into this webroot.

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

setSudo($sudo)

No description

Parameters

$sudo

details()

Return a map of the db & asset config details.

Calls sniff once and then caches

sniff()

Return a map of the db & asset config details, acquired with ssnap-sniffer

array execSudo(string|array $command, $options = array())

Execute a command on the relevant server, using the given sudo option

Parameters

string|array $command

Shell command, either a fully escaped string or an array

$options

Return Value

array

A map containing 'return', 'output', and 'error'

See also

Process::exec @param $options (optional) Extra options

putdb($sspak, bool $dropdb)

Put the database from the given sspak file into this webroot.

Parameters

$sspak
bool $dropdb

Drop the DB prior to install

putdb_MySQLPDODatabase($conf, $sspak, $dropdb)

No description

Parameters

$conf
$sspak
$dropdb

putdb_MySQLDatabase($conf, $sspak, $dropdb)

No description

Parameters

$conf
$sspak
$dropdb

putdb_PostgreSQLDatabase($conf, $sspak, $dropdb)

No description

Parameters

$conf
$sspak
$dropdb

putassets($sspak)

No description

There should be a return value or exception thrown to indicate success or failure to put assets

Parameters

$sspak

SSPakFile SSPak file to extract assets from

putgit(array $details)

Load a git remote into this webroot.

It expects that this remote is an empty directory.

Parameters

array $details

Map of git details