CoreUpdateService
Core update service.
This service handles core updates, all the nasty details are encapsulated here. The single public methods 'depend' on each other, for example a new core has to be downloaded before it can be unpacked.
Each method returns only TRUE of FALSE indicating if it was successful or not. Detailed information can be fetched with getMessages() and will return a list of status messages of the previous operation.
This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
Table of Contents
Properties
- $coreVersionService : CoreVersionService
- $downloadBaseUri : string
- Base URI for TYPO3 downloads
- $downloadTargetPath : string
- Absolute path to download location
- $messages : FlashMessageQueue
- $symlinkToCoreFiles : string
- Absolute path to the symlink pointing to the currently used TYPO3 core files
Methods
- __construct() : mixed
- activateVersion() : bool
- Activate a core version
- checkPreConditions() : bool
- Check if an update is possible at all
- downloadVersion() : bool
- Download the specified version
- getMessages() : FlashMessageQueue
- Get messages of previous method call
- isCoreUpdateEnabled() : bool
- Check if this installation wants to enable the core updater
- moveVersion() : bool
- Move an unpacked core to its final destination
- unpackVersion() : bool
- Unpack a downloaded core
- verifyFileChecksum() : bool
- Verify checksum of downloaded version
- checkCoreFilesAvailable() : bool
- Check if there is are already core files available at the download destination.
- discoverCurrentCoreSymlink() : string
- In future implementations we might implement some smarter logic here
- getDownloadTarGzTargetPath() : string
- Absolute path of downloaded .tar.gz
- getRelativePath() : string
- Get relative path to TYPO3 source directory from webroot
- setDownloadTargetPath() : mixed
- Create download location in case the folder does not exist
Properties
$coreVersionService
protected
CoreVersionService
$coreVersionService
$downloadBaseUri
Base URI for TYPO3 downloads
protected
string
$downloadBaseUri
$downloadTargetPath
Absolute path to download location
protected
string
$downloadTargetPath
$messages
protected
FlashMessageQueue
$messages
$symlinkToCoreFiles
Absolute path to the symlink pointing to the currently used TYPO3 core files
protected
string
$symlinkToCoreFiles
Methods
__construct()
public
__construct(CoreVersionService $coreVersionService) : mixed
Parameters
- $coreVersionService : CoreVersionService
activateVersion()
Activate a core version
public
activateVersion(CoreRelease $coreRelease) : bool
Parameters
- $coreRelease : CoreRelease
-
A core release to activate
Return values
bool —TRUE on success
checkPreConditions()
Check if an update is possible at all
public
checkPreConditions(CoreRelease $coreRelease, WebserverType $webserverType) : bool
Parameters
- $coreRelease : CoreRelease
-
The target core release
- $webserverType : WebserverType
-
The webserver type.
Return values
bool —TRUE on success
downloadVersion()
Download the specified version
public
downloadVersion(CoreRelease $coreRelease) : bool
Parameters
- $coreRelease : CoreRelease
-
A core release to download
Return values
bool —TRUE on success
getMessages()
Get messages of previous method call
public
getMessages() : FlashMessageQueue
Return values
FlashMessageQueueisCoreUpdateEnabled()
Check if this installation wants to enable the core updater
public
isCoreUpdateEnabled() : bool
Return values
boolmoveVersion()
Move an unpacked core to its final destination
public
moveVersion(CoreRelease $coreRelease) : bool
Parameters
- $coreRelease : CoreRelease
-
A core release to move
Return values
bool —TRUE on success
unpackVersion()
Unpack a downloaded core
public
unpackVersion(CoreRelease $coreRelease) : bool
Parameters
- $coreRelease : CoreRelease
-
A core release to unpack
Return values
bool —TRUE on success
verifyFileChecksum()
Verify checksum of downloaded version
public
verifyFileChecksum(CoreRelease $coreRelease) : bool
Parameters
- $coreRelease : CoreRelease
-
A downloaded core release to check
Return values
bool —TRUE on success
checkCoreFilesAvailable()
Check if there is are already core files available at the download destination.
protected
checkCoreFilesAvailable(string $version) : bool
Parameters
- $version : string
-
A version number
Return values
bool —true when core files are available
discoverCurrentCoreSymlink()
In future implementations we might implement some smarter logic here
protected
discoverCurrentCoreSymlink() : string
Return values
stringgetDownloadTarGzTargetPath()
Absolute path of downloaded .tar.gz
protected
getDownloadTarGzTargetPath(string $version) : string
Parameters
- $version : string
-
A version number
Return values
stringgetRelativePath()
Get relative path to TYPO3 source directory from webroot
protected
getRelativePath(string $absolutePath) : string
Parameters
- $absolutePath : string
-
to TYPO3 source directory
Return values
string —relative path to TYPO3 source directory
setDownloadTargetPath()
Create download location in case the folder does not exist
protected
setDownloadTargetPath(string $downloadTargetPath) : mixed
Parameters
- $downloadTargetPath : string