PHP 클래스 VisualAppeal\AutoUpdate

파일 보기 프로젝트 열기: visualappeal/php-auto-update 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$dirPermissions integer Create new folders with this privileges.
$updateScriptName string Update script filename.

보호된 프로퍼티들

프로퍼티 타입 설명
$_currentVersion vierbergenlars\SemVer\version Current version.
$_updateFile string Version filename on the server.
$_updateUrl string Url to the update folder on the server.

공개 메소드들

메소드 설명
__construct ( string $tempDir = null, string $installDir = null, integer $maxExecutionTime = 60 ) Create new instance
addLogHandler ( Monolog\Handler\HandlerInterface $handler ) Add a new logging handler.
addTrailingSlash ( string $dir ) : string Add slash at the end of the path.
checkUpdate ( ) : integer | boolean Check for a new version
getLatestVersion ( ) : vierbergenlars\SemVer\version Get the name of the latest version.
getSimulationResults ( ) : array Get the results of the last simulation.
getVersionsToUpdate ( ) : array Get an array of versions which will be installed.
newVersionAvailable ( ) : boolean Check if a new version is available.
setBasicAuth ( $username, $password ) Set authentication
setBranch ( $branch ) Set the update branch.
setCache ( Desarrolla2\Cache\Adapter\AdapterInterface $adapter, integer $ttl = 3600 ) Set the cache component.
setCurrentVersion ( string $currentVersion ) : boolean Set the version of the current installed software.
setInstallDir ( string $dir ) Set the install directory.
setTempDir ( string $dir ) Set the temporary download directory.
setUpdateFile ( string $updateFile ) Set the update filename.
setUpdateUrl ( string $updateUrl ) Set the update filename.
update ( boolean $simulateInstall = true, boolean $deleteDownload = true ) : mixed Update to the latest version

보호된 메소드들

메소드 설명
_downloadUpdate ( string $updateUrl, string $updateFile ) : boolean Download the update
_install ( string $updateFile, boolean $simulateInstall, $version ) : boolean Install update.
_simulateInstall ( string $updateFile ) : boolean Simulate update process.

비공개 메소드들

메소드 설명
_removeDir ( string $dir ) : void Remove directory recursively.
_useBasicAuth ( ) : null | resource Set authentication in update method of users and password exist

메소드 상세

__construct() 공개 메소드

Create new instance
public __construct ( string $tempDir = null, string $installDir = null, integer $maxExecutionTime = 60 )
$tempDir string
$installDir string
$maxExecutionTime integer

_downloadUpdate() 보호된 메소드

Download the update
protected _downloadUpdate ( string $updateUrl, string $updateFile ) : boolean
$updateUrl string Url where to download from
$updateFile string Path where to save the download
리턴 boolean

_install() 보호된 메소드

Install update.
protected _install ( string $updateFile, boolean $simulateInstall, $version ) : boolean
$updateFile string Path to the update file
$simulateInstall boolean Check for directory and file permissions before copying files
리턴 boolean

_simulateInstall() 보호된 메소드

Simulate update process.
protected _simulateInstall ( string $updateFile ) : boolean
$updateFile string
리턴 boolean

addLogHandler() 공개 메소드

Add a new logging handler.
public addLogHandler ( Monolog\Handler\HandlerInterface $handler )
$handler Monolog\Handler\HandlerInterface See https://github.com/Seldaek/monolog

addTrailingSlash() 공개 메소드

Add slash at the end of the path.
public addTrailingSlash ( string $dir ) : string
$dir string
리턴 string

checkUpdate() 공개 메소드

Check for a new version
public checkUpdate ( ) : integer | boolean
리턴 integer | boolean true: New version is available false: Error while checking for update int: Status code (i.e. AutoUpdate::NO_UPDATE_AVAILABLE)

getLatestVersion() 공개 메소드

Get the name of the latest version.
public getLatestVersion ( ) : vierbergenlars\SemVer\version
리턴 vierbergenlars\SemVer\version

getSimulationResults() 공개 메소드

Get the results of the last simulation.
public getSimulationResults ( ) : array
리턴 array

getVersionsToUpdate() 공개 메소드

Get an array of versions which will be installed.
public getVersionsToUpdate ( ) : array
리턴 array

newVersionAvailable() 공개 메소드

Check if a new version is available.
public newVersionAvailable ( ) : boolean
리턴 boolean

setBasicAuth() 공개 메소드

Set authentication
public setBasicAuth ( $username, $password )
$username
$password

setBranch() 공개 메소드

Set the update branch.
public setBranch ( $branch )

setCache() 공개 메소드

Set the cache component.
public setCache ( Desarrolla2\Cache\Adapter\AdapterInterface $adapter, integer $ttl = 3600 )
$adapter Desarrolla2\Cache\Adapter\AdapterInterface See https://github.com/desarrolla2/Cache
$ttl integer Time to live in seconds

setCurrentVersion() 공개 메소드

Set the version of the current installed software.
public setCurrentVersion ( string $currentVersion ) : boolean
$currentVersion string
리턴 boolean

setInstallDir() 공개 메소드

Set the install directory.
public setInstallDir ( string $dir )
$dir string

setTempDir() 공개 메소드

Set the temporary download directory.
public setTempDir ( string $dir )
$dir string

setUpdateFile() 공개 메소드

Set the update filename.
public setUpdateFile ( string $updateFile )
$updateFile string

setUpdateUrl() 공개 메소드

Set the update filename.
public setUpdateUrl ( string $updateUrl )
$updateUrl string

update() 공개 메소드

Update to the latest version
public update ( boolean $simulateInstall = true, boolean $deleteDownload = true ) : mixed
$simulateInstall boolean Check for directory and file permissions before copying files (Default: true)
$deleteDownload boolean Delete download after update (Default: true)
리턴 mixed integer|bool

프로퍼티 상세

$_currentVersion 보호되어 있는 프로퍼티

Current version.
protected version,vierbergenlars\SemVer $_currentVersion
리턴 vierbergenlars\SemVer\version

$_updateFile 보호되어 있는 프로퍼티

Version filename on the server.
protected string $_updateFile
리턴 string

$_updateUrl 보호되어 있는 프로퍼티

Url to the update folder on the server.
protected string $_updateUrl
리턴 string

$dirPermissions 공개적으로 프로퍼티

Create new folders with this privileges.
public int $dirPermissions
리턴 integer

$updateScriptName 공개적으로 프로퍼티

Update script filename.
public string $updateScriptName
리턴 string