TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Documentation\Service\DocumentationService Class Reference

Public Member Functions

 getOfficialDocuments ()
 
 getLocalExtensions ()
 
 fetchNearestDocument ($url, $key, $version='latest', $language='default')
 
 fetchDocument ($url, $key, $version='latest', $language='default')
 

Protected Member Functions

 getAvailablePackages ($url)
 
 parsePackagesXML ($string)
 
 unzipDocumentPackage ($file, $path)
 

Detailed Description

Service class to connect to docs.typo3.org.

Definition at line 22 of file DocumentationService.php.

Member Function Documentation

◆ fetchDocument()

TYPO3\CMS\Documentation\Service\DocumentationService::fetchDocument (   $url,
  $key,
  $version = 'latest',
  $language = 'default' 
)

◆ fetchNearestDocument()

TYPO3\CMS\Documentation\Service\DocumentationService::fetchNearestDocument (   $url,
  $key,
  $version = 'latest',
  $language = 'default' 
)

Fetches the nearest version of a document from docs.typo3.org.

Algorithm is as follows:

1) If exact version/language pair exists, fetch it 2) If document with version trimmed down to 2 digits and given language exists, fetch it 3) If document with version 'latest' and given language exists, fetch it 4) Restart at step 1) with language 'default'

Parameters
string$url
string$key
string$version
string$language
Returns
bool TRUE if fetch succeeded, otherwise FALSE

Definition at line 98 of file DocumentationService.php.

References TYPO3\CMS\Documentation\Service\DocumentationService\fetchDocument(), TYPO3\CMS\Documentation\Service\DocumentationService\getAvailablePackages(), and TYPO3\CMS\Core\Utility\GeneralUtility\isFirstPartOfStr().

◆ getAvailablePackages()

TYPO3\CMS\Documentation\Service\DocumentationService::getAvailablePackages (   $url)
protected

Returns the available packages (version + language) for a given document on docs.typo3.org.

Parameters
string$url
Returns
array

Definition at line 223 of file DocumentationService.php.

References $remote, TYPO3\CMS\Core\Utility\GeneralUtility\getUrl(), and TYPO3\CMS\Documentation\Service\DocumentationService\parsePackagesXML().

Referenced by TYPO3\CMS\Documentation\Service\DocumentationService\fetchDocument(), and TYPO3\CMS\Documentation\Service\DocumentationService\fetchNearestDocument().

◆ getLocalExtensions()

TYPO3\CMS\Documentation\Service\DocumentationService::getLocalExtensions ( )

◆ getOfficialDocuments()

TYPO3\CMS\Documentation\Service\DocumentationService::getOfficialDocuments ( )

◆ parsePackagesXML()

TYPO3\CMS\Documentation\Service\DocumentationService::parsePackagesXML (   $string)
protected

Parses content of packages.xml into a suitable array.

Parameters
string$string,XML data to parse
Exceptions

Definition at line 244 of file DocumentationService.php.

Referenced by TYPO3\CMS\Documentation\Service\DocumentationService\getAvailablePackages().

◆ unzipDocumentPackage()

TYPO3\CMS\Documentation\Service\DocumentationService::unzipDocumentPackage (   $file,
  $path 
)
protected

Unzips a document package.

Parameters
string$filepath to zip file
string$pathpath to extract to
Exceptions

Definition at line 277 of file DocumentationService.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), TYPO3\CMS\Core\Utility\GeneralUtility\mkdir_deep(), and TYPO3\CMS\Core\Utility\GeneralUtility\writeFile().

Referenced by TYPO3\CMS\Documentation\Service\DocumentationService\fetchDocument().