Webroot
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
Execute a command on the relevant server
Create a process for later exection
Upload a file to the given destination on the server
Create a file with the given content at the given destination on the server
Download a file from the given source on the server to the given file
Returns true if the given file or directory exists
Create the given file with the given content
Execute a command on the relevant server, using the given sudo option
Details
__construct($path, $executor)
No description
isLocal()
No description
getPath()
No description
getServer()
No description
setSSHItentityFile($filename)
No description
exec(string $command, $options = array())
Execute a command on the relevant server
Process
createProcess(string $command, $options = array())
Create a process for later exection
upload($source, string $dest)
Upload a file to the given destination on the server
uploadContent(string $content, string $dest)
Create a file with the given content at the given destination on the server
download(string $source, string $dest)
Download a file from the given source on the server to the given file
bool
exists(string $file = null)
Returns true if the given file or directory exists
writeFile($file, $content)
Create the given file with the given content
unlink(string $file)
Remove a file or folder from the webroot's server
setSudo($sudo)
No description
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
putdb($sspak, bool $dropdb)
Put the database from the given sspak file into this webroot.
putdb_MySQLPDODatabase($conf, $sspak, $dropdb)
No description
putdb_MySQLDatabase($conf, $sspak, $dropdb)
No description
putdb_PostgreSQLDatabase($conf, $sspak, $dropdb)
No description
putassets($sspak)
No description
There should be a return value or exception thrown to indicate success or failure to put assets
putgit(array $details)
Load a git remote into this webroot.
It expects that this remote is an empty directory.