PHP Класс Banago\PHPloy\PHPloy

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$cli League\CLImate\CLImate
$copyDirs array
$currentlyDeploying string Keep track of which server we are currently deploying to.
$dotRevisionFilename string The name of the file on remote servers that stores the current revision hash.
$filesToExclude array A list of files that should NOT be uploaded to the named server.
$filesToInclude A list of patterns that a file MUST match to be uploaded to the remote server.
$git Git
$globalFilesToExclude array A list of files that should NOT be uploaded to any of the servers.
$hooks array
$iniFilename string The filename from which to read remote server details.
$localRevision string
$passFile string The filename from which to read server password.
$postDeploy array
$postDeployRemote array
$preDeploy array
$preDeployRemote array
$purgeDirs array
$revision string
$scanSubSubmodules boolean If you need support for sub-submodules, ensure this is set to TRUE Set to false when the --exclude-subsubmodules command line option is used.
$scanSubmodules boolean To activate submodule deployment use the --submodules argument.
$servers array
$submodules array

Защищенные свойства (Protected)

Свойство Тип Описание
$connection League\Flysystem\Filesystem;
$currentSubmoduleName boolean | string
$debug boolean Whether to print extra debugging info to the console, especially for git & FTP commands Activated using --debug command line option.
$defaultServer boolean Keep track of if a default server has been configured.
$deployAll Weather the --all command line option was given.
$deploymentSize integer Keep track of current deployment size.
$dotRevision string Holds the path to the .revision file For the main repository this will be the value of $dotRevisionFilename ('.revision' by default) but for submodules, the submodule path will be prepended.
$init Whether the --init command line option was given.
$listFiles boolean Whether phploy is running in list mode (--list or -l commands).
$mainRepo string
$repo string
$server string
$sync boolean Whether the --sync command line option was given.
$version string

Открытые методы

Метод Описание
__construct ( ) Constructor.
checkSubSubmodules ( string $repo, string $name ) Check for sub-submodules.
checkSubmodules ( string $repo ) Check for submodules.
compare ( string $localRevision ) : array Compare revisions and returns array of files to upload:.
copy ( $copyDirs ) Copy given directory's contents.
debug ( string $message ) Helper method to output messages to the console (only in debug mode) Debug mode is activated by setting $this->debug = true or using the command line option --debug.
deploy ( ) Deploy (or list) changed files.
directoryToArray ( string $directory, boolean $recursive = true, boolean $listDirs = false, boolean $listFiles = true, string $exclude = '' ) : array Get an array that represents directory tree Credit: http://php.net/manual/en/function.scandir.php#109140.
executeOnRemoteServer ( array $commands )
getPasswordFile ( ) : string Returns the full path to password file.
getPasswordFromIniFile ( string $servername ) : string Try to fetch password from .phploy file if not found, an empty string will be returned.
hasDeletedDirectories ( array $filesToDelete ) : array Checks for deleted directories. Git cares only about files.
humanFilesize ( integer $bytes, integer $decimals = 2 ) : string Return a human readable filesize.
listFiles ( array $files ) Check what files will be uploaded/deleted.
parseIniFile ( string $iniFile ) : array Parse an ini file and return values as array.
patternMatch ( string $pattern, string $string ) : string Glob the file path.
postDeploy ( array $commands ) Execute post commands.
postDeployRemote ( array $commands ) Execute post commands on remote server.
preDeploy ( array $commands ) Execute pre commands.
preDeployRemote ( array $commands ) Execute pre commands on remote server.
prepareServers ( ) Reads the phploy.ini file and populates the $this->servers array.
purge ( $purgeDirs ) Purge given directory's contents.
push ( array $files, $localRevision = null ) Update the current remote server with the array of files provided.
setRevision ( $localRevision = null ) Sets revision on the server.
setup ( ) Setup CLI options.

Защищенные методы

Метод Описание
createSampleIniFile ( ) Creates sample ini file.
log ( string $message, string $type = 'INFO' ) Log a message to file.
relPath ( string $el ) : string Strip Absolute Path.

Приватные методы

Метод Описание
currentBranch ( ) : string Gets the current branch name.
currentRevision ( ) : string Get current revision.
filterIgnoredFiles ( array $files ) : array Filter ignore files.
filterIncludedFiles ( array $files ) : array Filter included files.
getPassword ( ) : string Gets the password from user input, hiding password and replaces it with stars (*) if user users Unix / Mac.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( )

checkSubSubmodules() публичный Метод

Check for sub-submodules.
public checkSubSubmodules ( string $repo, string $name )
$repo string
$name string

checkSubmodules() публичный Метод

Check for submodules.
public checkSubmodules ( string $repo )
$repo string

compare() публичный Метод

[ 'upload' => $filesToUpload, 'delete' => $filesToDelete ];
public compare ( string $localRevision ) : array
$localRevision string
Результат array

copy() публичный Метод

Copy given directory's contents.
public copy ( $copyDirs )

createSampleIniFile() защищенный Метод

Creates sample ini file.
protected createSampleIniFile ( )

debug() публичный Метод

Helper method to output messages to the console (only in debug mode) Debug mode is activated by setting $this->debug = true or using the command line option --debug.
public debug ( string $message )
$message string Message to display on the console

deploy() публичный Метод

Deploy (or list) changed files.
public deploy ( )

directoryToArray() публичный Метод

Get an array that represents directory tree Credit: http://php.net/manual/en/function.scandir.php#109140.
public directoryToArray ( string $directory, boolean $recursive = true, boolean $listDirs = false, boolean $listFiles = true, string $exclude = '' ) : array
$directory string Directory path
$recursive boolean Include sub directories
$listDirs boolean Include directories on listing
$listFiles boolean Include files on listing
$exclude string Exclude paths that matches this regex
Результат array

executeOnRemoteServer() публичный Метод

public executeOnRemoteServer ( array $commands )
$commands array

getPasswordFile() публичный Метод

Returns the full path to password file.
public getPasswordFile ( ) : string
Результат string

getPasswordFromIniFile() публичный Метод

Try to fetch password from .phploy file if not found, an empty string will be returned.
public getPasswordFromIniFile ( string $servername ) : string
$servername string Server to fetch password for
Результат string

hasDeletedDirectories() публичный Метод

Checks for deleted directories. Git cares only about files.
public hasDeletedDirectories ( array $filesToDelete ) : array
$filesToDelete array
Результат array

humanFilesize() публичный Метод

Return a human readable filesize.
public humanFilesize ( integer $bytes, integer $decimals = 2 ) : string
$bytes integer
$decimals integer
Результат string

listFiles() публичный Метод

Check what files will be uploaded/deleted.
public listFiles ( array $files )
$files array

log() защищенный Метод

Log a message to file.
protected log ( string $message, string $type = 'INFO' )
$message string The message to write
$type string The type of log message (e.g. INFO, DEBUG, ERROR, etc.)

parseIniFile() публичный Метод

Parse an ini file and return values as array.
public parseIniFile ( string $iniFile ) : array
$iniFile string
Результат array

patternMatch() публичный Метод

Glob the file path.
public patternMatch ( string $pattern, string $string ) : string
$pattern string
$string string
Результат string

postDeploy() публичный Метод

Execute post commands.
public postDeploy ( array $commands )
$commands array

postDeployRemote() публичный Метод

Execute post commands on remote server.
public postDeployRemote ( array $commands )
$commands array

preDeploy() публичный Метод

Execute pre commands.
public preDeploy ( array $commands )
$commands array

preDeployRemote() публичный Метод

Execute pre commands on remote server.
public preDeployRemote ( array $commands )
$commands array

prepareServers() публичный Метод

Reads the phploy.ini file and populates the $this->servers array.
public prepareServers ( )

purge() публичный Метод

Purge given directory's contents.
public purge ( $purgeDirs )

push() публичный Метод

Update the current remote server with the array of files provided.
public push ( array $files, $localRevision = null )
$files array 2-dimensional array with 2 indices: 'upload' and 'delete' Each of these contains an array of filenames and paths (relative to repository root)

relPath() защищенный Метод

Strip Absolute Path.
protected relPath ( string $el ) : string
$el string
Результат string

setRevision() публичный Метод

Sets revision on the server.
public setRevision ( $localRevision = null )

setup() публичный Метод

Setup CLI options.
public setup ( )

Описание свойств

$cli публичное свойство

public CLImate,League\CLImate $cli
Результат League\CLImate\CLImate

$connection защищенное свойство

protected Filesystem;,League\Flysystem $connection
Результат League\Flysystem\Filesystem;

$copyDirs публичное свойство

public array $copyDirs
Результат array

$currentSubmoduleName защищенное свойство

protected bool|string $currentSubmoduleName
Результат boolean | string

$currentlyDeploying публичное свойство

Keep track of which server we are currently deploying to.
public string $currentlyDeploying
Результат string

$debug защищенное свойство

Whether to print extra debugging info to the console, especially for git & FTP commands Activated using --debug command line option.
protected bool $debug
Результат boolean

$defaultServer защищенное свойство

Keep track of if a default server has been configured.
protected bool $defaultServer
Результат boolean

$deployAll защищенное свойство

Weather the --all command line option was given.
protected $deployAll

$deploymentSize защищенное свойство

Keep track of current deployment size.
protected int $deploymentSize
Результат integer

$dotRevision защищенное свойство

Holds the path to the .revision file For the main repository this will be the value of $dotRevisionFilename ('.revision' by default) but for submodules, the submodule path will be prepended.
protected string $dotRevision
Результат string

$dotRevisionFilename публичное свойство

The name of the file on remote servers that stores the current revision hash.
public string $dotRevisionFilename
Результат string

$filesToExclude публичное свойство

A list of files that should NOT be uploaded to the named server.
public array $filesToExclude
Результат array

$filesToInclude публичное свойство

A list of patterns that a file MUST match to be uploaded to the remote server.
public $filesToInclude

$git публичное свойство

public Git,Banago\PHPloy $git
Результат Git

$globalFilesToExclude публичное свойство

A list of files that should NOT be uploaded to any of the servers.
public array $globalFilesToExclude
Результат array

$hooks публичное свойство

public array $hooks
Результат array

$iniFilename публичное свойство

The filename from which to read remote server details.
public string $iniFilename
Результат string

$init защищенное свойство

Whether the --init command line option was given.
protected $init

$listFiles защищенное свойство

Whether phploy is running in list mode (--list or -l commands).
protected bool $listFiles
Результат boolean

$localRevision публичное свойство

public string $localRevision
Результат string

$mainRepo защищенное свойство

protected string $mainRepo
Результат string

$passFile публичное свойство

The filename from which to read server password.
public string $passFile
Результат string

$postDeploy публичное свойство

public array $postDeploy
Результат array

$postDeployRemote публичное свойство

public array $postDeployRemote
Результат array

$preDeploy публичное свойство

public array $preDeploy
Результат array

$preDeployRemote публичное свойство

public array $preDeployRemote
Результат array

$purgeDirs публичное свойство

public array $purgeDirs
Результат array

$repo защищенное свойство

protected string $repo
Результат string

$revision публичное свойство

public string $revision
Результат string

$scanSubSubmodules публичное свойство

If you need support for sub-submodules, ensure this is set to TRUE Set to false when the --exclude-subsubmodules command line option is used.
public bool $scanSubSubmodules
Результат boolean

$scanSubmodules публичное свойство

To activate submodule deployment use the --submodules argument.
public bool $scanSubmodules
Результат boolean

$server защищенное свойство

protected string $server
Результат string

$servers публичное свойство

public array $servers
Результат array

$submodules публичное свойство

public array $submodules
Результат array

$sync защищенное свойство

Whether the --sync command line option was given.
protected bool $sync
Результат boolean

$version защищенное свойство

protected string $version
Результат string