TYPO3  7.6
Public Member Functions | Protected Member Functions | List of all members
TerService Class Reference
Inheritance diagram for TerService:
TerUtility SingletonInterface

Public Member Functions

 fetchTranslationStatus ($extensionKey, $mirrorUrl)
 
 updateTranslation ($extensionKey, $language, $mirrorUrl)
 
- Public Member Functions inherited from TerUtility
 injectConfigurationUtility (\TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility $configurationUtility)
 
 fetchExtension ($extensionKey, $version, $expectedMd5, $mirrorUrl)
 
 decodeServerData ($externalData)
 
 decodeExchangeData ($stream)
 

Protected Member Functions

 parseL10nXML ($string)
 
 fetchTranslation ($extensionKey, $language, $mirrorUrl)
 
 unzipTranslationFile ($file, $path)
 

Additional Inherited Members

- Public Attributes inherited from TerUtility
 $wsdlUrl
 
- Protected Attributes inherited from TerUtility
 $configurationUtility
 

Detailed Description

Extends of extensionmanager ter connection to enrich with translation related methods

Definition at line 24 of file TerService.php.

Member Function Documentation

fetchTranslation (   $extensionKey,
  $language,
  $mirrorUrl 
)
protected

Fetches an extensions l10n file from the given mirror

Parameters
string$extensionKeyExtension Key
string$languageThe language code of the translation to fetch
string$mirrorUrlURL of mirror to use
Exceptions
\TYPO3\CMS\Lang\Exception\XmlParser
Returns
array Array containing l10n data

Definition at line 163 of file TerService.php.

References ExtensionManagementUtility\extPath(), and GeneralUtility\strtolower().

Referenced by TerService\updateTranslation().

fetchTranslationStatus (   $extensionKey,
  $mirrorUrl 
)

Fetches extensions translation status

Parameters
string$extensionKeyExtension Key
string$mirrorUrlURL of mirror to use
Returns
mixed

Definition at line 33 of file TerService.php.

References TerService\parseL10nXML(), and GeneralUtility\strtolower().

parseL10nXML (   $string)
protected

Parses content of *-l10n.xml into a suitable array

Parameters
string$string,:XML data to parse
Exceptions
\TYPO3\CMS\Lang\Exception\XmlParser
Returns
array Array representation of XML data

Definition at line 53 of file TerService.php.

Referenced by TerService\fetchTranslationStatus().

unzipTranslationFile (   $file,
  $path 
)
protected

Unzip an language zip file

Parameters
string$filepath to zip file
string$pathpath to extract to
Exceptions
\TYPO3\CMS\Lang\Exception\Language
Returns
bool

Definition at line 201 of file TerService.php.

References GeneralUtility\getFileAbsFileName(), GeneralUtility\mkdir_deep(), and GeneralUtility\writeFile().

Referenced by TerService\updateTranslation().

updateTranslation (   $extensionKey,
  $language,
  $mirrorUrl 
)

Install translations for all selected languages for an extension

Parameters
string$extensionKeyThe extension key to install the translations for
string$languageLanguage code of translation to fetch
string$mirrorUrlMirror URL to fetch data from
Returns
bool TRUE on success, error string on failure

Definition at line 124 of file TerService.php.

References TerService\fetchTranslation(), GeneralUtility\getFileAbsFileName(), GeneralUtility\mkdir_deep(), GeneralUtility\rmdir(), TerService\unzipTranslationFile(), and GeneralUtility\writeFileToTypo3tempDir().