TYPO3  7.6
Public Member Functions | Protected Member Functions | List of all members
DocumentationService Class Reference

Public Member Functions

 getOfficialDocuments ()
 
 getLocalExtensions ()
 
 fetchNearestDocument ($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

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 $url, DocumentationService\getAvailablePackages(), and GeneralUtility\isFirstPartOfStr().

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 225 of file DocumentationService.php.

References $url, GeneralUtility\getUrl(), and DocumentationService\parsePackagesXML().

Referenced by DocumentationService\fetchNearestDocument().

getLocalExtensions ( )

Returns the list of local extensions.

Returns
array

Definition at line 52 of file DocumentationService.php.

References $GLOBALS, and GeneralUtility\getFileAbsFileName().

getOfficialDocuments ( )

Returns the list of official documents on docs.typo3.org.

Returns
array

Definition at line 29 of file DocumentationService.php.

References GeneralUtility\getFileAbsFileName(), GeneralUtility\getUrl(), and GeneralUtility\writeFileToTypo3tempDir().

parsePackagesXML (   $string)
protected

Parses content of packages.xml into a suitable array.

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

Definition at line 246 of file DocumentationService.php.

Referenced by DocumentationService\getAvailablePackages().

unzipDocumentPackage (   $file,
  $path 
)
protected

Unzips a document package.

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

Definition at line 276 of file DocumentationService.php.

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