Commit d963ce08 authored by Thomas Löffler's avatar Thomas Löffler

Get documentation information as assoc array

parent ff4fb8d8
Pipeline #7113 passed with stages
in 2 minutes and 48 seconds
......@@ -43,7 +43,7 @@ class DocumentationService implements \TYPO3\CMS\Core\SingletonInterface
'pdf'
];
$documentationFile = PATH_site . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] . 'currentdocumentationdata.json';
$this->docsInformation = json_decode(file_get_contents($documentationFile));
$this->docsInformation = json_decode(file_get_contents($documentationFile), true);
}
/**
......@@ -61,13 +61,13 @@ class DocumentationService implements \TYPO3\CMS\Core\SingletonInterface
throw new \Exception('Extension key and version string are required to build a documentation url');
}
$manualExists = isset($this->docsInformation->{$extensionKey}['docs'][$versionString]);
$manualExists = isset($this->docsInformation[$extensionKey]['docs'][$versionString]);
$documentationLink = null;
$url = null;
if ($manualExists) {
// link to extension to get the latest manual
$url = $this->docsInformation->{$extensionKey}['docs'][$versionString]['url'];
$url = $this->docsInformation[$extensionKey]['docs'][$versionString]['url'];
// check if link is not broken
// need to remove the 200 response check due to change in header for docs.typo3.org
$documentationLink = '<a href="' . $url . '">Extension Manual</a>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment