PHP 클래스 Banago\PHPloy\PHPloy

파일 보기 프로젝트 열기: banago/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

보호된 프로퍼티들

프로퍼티 타입 설명
$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