프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$afterUpdateCommands | list of shell commands, which should be executed after project update. If command is a string it will be executed as shell command, otherwise as PHP callback. For example: php [ 'php /path/to/project/yii migrate/up --interactive=0' ], | ||
$beforeUpdateCommands | list of commands, which should be executed before project update begins. If command is a string it will be executed as shell command, otherwise as PHP callback. For example: php [ 'mysqldump -h localhost -u root myproject > /path/to/backup/myproject.sql' ], | ||
$cache | list of cache application components, for which [[Cache::flush()]] method should be invoked. Component ids, instances or array configurations can be used here. | ||
$composerBinPath | path to the 'composer' bin command. By default simple 'composer' is used, assuming it available as global shell command. Path alias can be used here. For example: '@app/composer.phar'. | ||
$composerOptions | composer command options. | ||
$composerRootPaths | list of composer install root paths (the ones containing 'composer.json'). Path aliases can be used here. | ||
$configFile | configuration file name. Settings from this file will be merged with the default ones. Such configuration file can be created, using action 'config'. Path alias can be used here, for example: '@app/config/self-update.php'. | ||
$defaultAction | controller default action ID. | ||
$emails | list of email addresses, which should be used to send execution reports. | ||
$mailer | the mailer object or the application component ID of the mailer. It will be used to send notification messages to [[emails]]. If not set or sending email via this component fails, the fallback to the plain PHP mail() function will be used instead. | ||
$mutex | the mutex object or the application component ID of the mutex. After the controller object is created, if you want to change this property, you should only assign it with a mutex connection object. | ||
$projectRootPath | path to project root directory, which means VCS root directory. Path aliases can be use here. | ||
$shellResponseErrorKeywords | list of keywords, which presence in the shell command output is considered as its execution error. | ||
$tmpDirectories | list of temporary directories, which should be cleared after project update. Path aliases can be used here. For example: php [ '@app/web/assets', '@runtime/URI', '@runtime/HTML', '@runtime/debug', ] | ||
$versionControlSystems | list of possible version control systems (VCS) in format: vcsFolderName => classConfig. VCS will be detected automatically based on which folder is available inside [[projectRootPath]] | ||
$webPaths | project web path stubs configuration. Each path configuration should have following keys: - 'path' - string - path to web root folder - 'link' - string - path for the symbolic link, which should point to the web root - 'stub' - string - path to folder, which contains stub for the web Yii aliases can be used for all these keys. For example: php [ [ 'path' => '@app/web', 'link' => '@app/httpdocs', 'stub' => '@app/webstub', ] ] |
메소드 | 설명 | |
---|---|---|
actionConfig ( string $fileName ) : integer | Creates a configuration file for the "perform" command. | |
actionPerform ( string | null $configFile = null ) : integer | Performs project update from VCS. | |
getCurrentDate ( ) : string | ||
getHostName ( ) : string | ||
getReportFrom ( ) : string | ||
setHostName ( string $hostName ) | ||
setReportFrom ( string $reportFrom ) |
메소드 | 설명 | |
---|---|---|
acquireMutex ( ) : boolean | Acquires current action lock. | |
clearDirectory ( string $dir ) | Clears specified directory. | |
clearTmpDirectories ( ) | Clears all directories specified via [[tmpDirectories]]. | |
composeMutexName ( ) : string | Composes the mutex name. | |
detectVersionControlSystem ( string $path ) : yii2tech\selfupdate\VersionControlSystemInterface | Detects version control system used for the project. | |
execShellCommand ( string $command, array $placeholders = [] ) : string | Executes shell command. | |
executeCommands ( array $commands ) | Executes list of given commands. | |
flushCache ( ) | Flushes cache for all components specified at [[cache]]. | |
flushLog ( ) : array | Flushes log lines, returning them. | |
linkWebPaths ( ) | Links web roots to the actual web directories. | |
linkWebStubs ( ) | Links web roots to the stub directories. | |
log ( string $message ) | Logs the message | |
normalizeWebPaths ( ) | Normalizes [[webPaths]] value. | |
releaseMutex ( ) : boolean | Release current action lock. | |
reportFail ( ) | Sends report about failure. | |
reportResult ( string $subjectPrefix ) | Sends execution report. | |
reportSuccess ( ) | Sends report about success. | |
sendEmail ( string $from, string $email, string $subject, string $message ) : boolean | Sends an email. | |
sendEmailFallback ( string $from, string $email, string $subject, string $message ) : boolean | Sends an email via plain PHP mail() function. | |
updateVendor ( ) | Performs vendors update via Composer at all [[composerRootPaths]]. |
protected acquireMutex ( ) : boolean | ||
리턴 | boolean | lock acquiring result. |
public actionConfig ( string $fileName ) : integer | ||
$fileName | string | output file name or alias. |
리턴 | integer | CLI exit code |
protected clearDirectory ( string $dir ) | ||
$dir | string | directory to be cleared. |
protected clearTmpDirectories ( ) |
protected composeMutexName ( ) : string | ||
리턴 | string | mutex name. |
protected detectVersionControlSystem ( string $path ) : yii2tech\selfupdate\VersionControlSystemInterface | ||
$path | string | project root path. |
리턴 | yii2tech\selfupdate\VersionControlSystemInterface | version control system instance. |
protected executeCommands ( array $commands ) | ||
$commands | array | commands to be executed. |
protected flushCache ( ) |
public getReportFrom ( ) : string | ||
리턴 | string | email address, which should be used to send report email messages. |
protected releaseMutex ( ) : boolean | ||
리턴 | boolean | lock release result. |
protected reportResult ( string $subjectPrefix ) | ||
$subjectPrefix | string | report message subject. |
public setReportFrom ( string $reportFrom ) | ||
$reportFrom | string | email address, which should be used to send report email messages. |
protected updateVendor ( ) |
public $afterUpdateCommands |
public $beforeUpdateCommands |
public $cache |
public $composerBinPath |
public $composerRootPaths |
public $configFile |
public $emails |
public $mailer |
public $mutex |
public $projectRootPath |
public $shellResponseErrorKeywords |
public $tmpDirectories |
public $versionControlSystems |
public $webPaths |