‪TYPO3CMS  11.5
TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote Class Reference
Inheritance diagram for TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote:
TYPO3\CMS\Extensionmanager\Remote\ExtensionDownloaderRemoteInterface TYPO3\CMS\Extensionmanager\Remote\ListableRemoteInterface

Public Member Functions

 __construct (string $identifier, array $options=[])
 
 getIdentifier ()
 
 getAvailablePackages (bool $force=false)
 
 needsUpdate ()
 
 getLastUpdate ()
 
 downloadExtension (string $extensionKey, string $version, FileHandlingUtility $fileHandler, string $verificationHash=null, string $pathType='Local')
 

Protected Member Functions

bool isDownloadedExtensionListUpToDate ()
 
 fetchPackageList ()
 
ResponseInterface downloadFile (string $remotePath)
 
bool isDownloadedPackageValid (string $expectedHash, string $fileContents)
 
array decodeExchangeData (string $stream)
 

Protected Attributes

string $identifier
 
string $localExtensionListCacheFile
 
string $remoteBase = 'https://extensions.typo3.org/fileadmin/ter/'
 

Detailed Description

Class for downloading .t3x files from extensions.typo3.org and validating the results. This also includes the ListableRemoteInterface, which means it downloads extensions.xml.gz files and can import it in the database.

This is the only dependency for the concrete TER implementation on extensions.typo3.org and encapsulates the definition where an extension is located in TER.

Not responsible for:

  • ‪installing / activating an extension

Definition at line 38 of file TerExtensionRemote.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::__construct ( string  $identifier,
array  $options = [] 
)

Member Function Documentation

◆ decodeExchangeData()

array TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::decodeExchangeData ( string  $stream)
protected

Decodes extension array from t3x file contents. This kind of data is when an extension is uploaded to TER

Parameters
string$stream‪Data stream
Exceptions
VerificationFailedException
Returns
‪array Array with result on success, otherwise an error string.

Definition at line 198 of file TerExtensionRemote.php.

References $output, and TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote\isDownloadedPackageValid().

Referenced by TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote\downloadExtension().

◆ downloadExtension()

TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::downloadExtension ( string  $extensionKey,
string  $version,
FileHandlingUtility  $fileHandler,
string  $verificationHash = null,
string  $pathType = 'Local' 
)

◆ downloadFile()

ResponseInterface TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::downloadFile ( string  $remotePath)
protected

◆ fetchPackageList()

TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::fetchPackageList ( )
protected

◆ getAvailablePackages()

TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::getAvailablePackages ( bool  $force = false)

◆ getIdentifier()

TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::getIdentifier ( )

Returns the remote identifier

Returns
‪string

Implements TYPO3\CMS\Extensionmanager\Remote\ExtensionDownloaderRemoteInterface.

Definition at line 62 of file TerExtensionRemote.php.

References TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote\$identifier.

◆ getLastUpdate()

TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::getLastUpdate ( )

Get the time when the remote was updated the last time.

Returns
‪\DateTimeInterface

Implements TYPO3\CMS\Extensionmanager\Remote\ListableRemoteInterface.

Definition at line 107 of file TerExtensionRemote.php.

Referenced by TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote\needsUpdate().

◆ isDownloadedExtensionListUpToDate()

bool TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::isDownloadedExtensionListUpToDate ( )
protected

TER provides an extensions.md5 which contains the hashsum of the current remote extensions.gz file. Let's check if this is the same, if so, it is not needed to download a new extensions.gz.

Returns
‪bool

Definition at line 93 of file TerExtensionRemote.php.

References TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote\downloadFile().

Referenced by TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote\needsUpdate().

◆ isDownloadedPackageValid()

bool TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::isDownloadedPackageValid ( string  $expectedHash,
string  $fileContents 
)
protected

Validates the integrity of the contents of a downloaded file.

Parameters
string$expectedHash
string$fileContents
Returns
‪bool

Definition at line 185 of file TerExtensionRemote.php.

Referenced by TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote\decodeExchangeData(), and TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote\downloadExtension().

◆ needsUpdate()

TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::needsUpdate ( )

Member Data Documentation

◆ $identifier

string TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::$identifier
protected

◆ $localExtensionListCacheFile

string TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::$localExtensionListCacheFile
protected

Definition at line 46 of file TerExtensionRemote.php.

◆ $remoteBase

string TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::$remoteBase = 'https://extensions.typo3.org/fileadmin/ter/'
protected

Definition at line 50 of file TerExtensionRemote.php.