@@ -220,7 +220,7 @@ |
||
| 220 | 220 | // Register AJAX eID handlers. |
| 221 | 221 | $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = \Kitodo\Dlf\Plugin\Eid\SearchSuggest::class . '::main'; |
| 222 | 222 | $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_in_document'] = \Kitodo\Dlf\Plugin\Eid\SearchInDocument::class . '::main'; |
| 223 | -if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['enableInternalProxy'] ?? false) { |
|
| 223 | +if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['enableInternalProxy'] ?? FALSE) { |
|
| 224 | 224 | $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Plugin\Eid\PageViewProxy::class . '::main'; |
| 225 | 225 | } |
| 226 | 226 | // Use Caching Framework for Solr queries |
@@ -65,22 +65,22 @@ |
||
| 65 | 65 | $_EXTKEY = 'dlf'; |
| 66 | 66 | // Register tools for toolbox plugin. |
| 67 | 67 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'] = []; |
| 68 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltexttool'; |
|
| 69 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.annotationtool'; |
|
| 70 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_fulltextdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltextdownloadtool'; |
|
| 71 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagedownloadtool'; |
|
| 72 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagemanipulationtool'; |
|
| 73 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.pdfdownloadtool'; |
|
| 74 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.searchindocumenttool'; |
|
| 68 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltexttool'; |
|
| 69 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.annotationtool'; |
|
| 70 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_fulltextdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltextdownloadtool'; |
|
| 71 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagedownloadtool'; |
|
| 72 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagemanipulationtool'; |
|
| 73 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.pdfdownloadtool'; |
|
| 74 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.searchindocumenttool'; |
|
| 75 | 75 | // Register hooks. |
| 76 | 76 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
| 77 | 77 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
| 78 | 78 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Common/MetsDocument.php']['hookClass'][] = \Kitodo\Dlf\Hooks\KitodoProductionHacks::class; |
| 79 | 79 | // Register AJAX eID handlers. |
| 80 | -$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = \Kitodo\Dlf\Plugin\Eid\SearchSuggest::class . '::main'; |
|
| 81 | -$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_in_document'] = \Kitodo\Dlf\Plugin\Eid\SearchInDocument::class . '::main'; |
|
| 80 | +$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = \Kitodo\Dlf\Plugin\Eid\SearchSuggest::class.'::main'; |
|
| 81 | +$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_in_document'] = \Kitodo\Dlf\Plugin\Eid\SearchInDocument::class.'::main'; |
|
| 82 | 82 | if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['enableInternalProxy'] ?? false) { |
| 83 | - $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Plugin\Eid\PageViewProxy::class . '::main'; |
|
| 83 | + $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Plugin\Eid\PageViewProxy::class.'::main'; |
|
| 84 | 84 | } |
| 85 | 85 | // Use Caching Framework for Solr queries |
| 86 | 86 | if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_dlf_solr'])) { |
@@ -34,8 +34,7 @@ discard block |
||
| 34 | 34 | * @subpackage dlf |
| 35 | 35 | * @access public |
| 36 | 36 | */ |
| 37 | -class PageViewProxy |
|
| 38 | -{ |
|
| 37 | +class PageViewProxy { |
|
| 39 | 38 | /** |
| 40 | 39 | * @var RequestFactory |
| 41 | 40 | */ |
@@ -46,8 +45,7 @@ discard block |
||
| 46 | 45 | */ |
| 47 | 46 | protected $extConf; |
| 48 | 47 | |
| 49 | - public function __construct() |
|
| 50 | - { |
|
| 48 | + public function __construct() { |
|
| 51 | 49 | $this->requestFactory = GeneralUtility::makeInstance(RequestFactory::class); |
| 52 | 50 | $this->extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('dlf'); |
| 53 | 51 | } |
@@ -173,8 +171,7 @@ discard block |
||
| 173 | 171 | * @param ServerRequestInterface $request |
| 174 | 172 | * @return ResponseInterface |
| 175 | 173 | */ |
| 176 | - public function main(ServerRequestInterface $request) |
|
| 177 | - { |
|
| 174 | + public function main(ServerRequestInterface $request) { |
|
| 178 | 175 | switch ($request->getMethod()) { |
| 179 | 176 | case 'OPTIONS': |
| 180 | 177 | return $this->handleOptions($request); |
@@ -140,11 +140,11 @@ |
||
| 140 | 140 | // For performance, don't download content up-front. Rather, we'll |
| 141 | 141 | // download and upload simultaneously. |
| 142 | 142 | // https://docs.guzzlephp.org/en/6.5/request-options.html#stream |
| 143 | - 'stream' => true, |
|
| 143 | + 'stream' => TRUE, |
|
| 144 | 144 | |
| 145 | 145 | // Don't throw exceptions when a non-success status code is |
| 146 | 146 | // received. We handle these manually. |
| 147 | - 'http_errors' => false, |
|
| 147 | + 'http_errors' => FALSE, |
|
| 148 | 148 | ]); |
| 149 | 149 | } catch (\Exception $e) { |
| 150 | 150 | return new JsonResponse(['message' => 'Could not fetch resource of given URL.'], 500); |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | { |
| 24 | 24 | use StreamDecoratorTrait; |
| 25 | 25 | |
| 26 | - public function emit() |
|
| 27 | - { |
|
| 26 | + public function emit() { |
|
| 28 | 27 | // Disable output buffering |
| 29 | 28 | ob_end_flush(); |
| 30 | 29 | |
@@ -16,63 +16,63 @@ |
||
| 16 | 16 | // Plugin "audioplayer". |
| 17 | 17 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_audioplayer'] = 'layout,select_key,pages,recursive'; |
| 18 | 18 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_audioplayer'] = 'pi_flexform'; |
| 19 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_audioplayer', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/AudioPlayer.xml'); |
|
| 19 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_audioplayer', 'FILE:EXT:'.'dlf/Configuration/Flexforms/AudioPlayer.xml'); |
|
| 20 | 20 | // Plugin "basket". |
| 21 | 21 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_basket'] = 'layout,select_key,pages,recursive'; |
| 22 | 22 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_basket'] = 'pi_flexform'; |
| 23 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_basket', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Basket.xml'); |
|
| 23 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_basket', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Basket.xml'); |
|
| 24 | 24 | // Plugin "calendar". |
| 25 | 25 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_calendar'] = 'layout,select_key,pages,recursive'; |
| 26 | 26 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_calendar'] = 'pi_flexform'; |
| 27 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_calendar', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Calendar.xml'); |
|
| 27 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_calendar', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Calendar.xml'); |
|
| 28 | 28 | // Plugin "collection". |
| 29 | 29 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_collection'] = 'layout,select_key,pages,recursive'; |
| 30 | 30 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_collection'] = 'pi_flexform'; |
| 31 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_collection', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Collection.xml'); |
|
| 31 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_collection', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Collection.xml'); |
|
| 32 | 32 | // Plugin "feeds". |
| 33 | 33 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_feeds'] = 'layout,select_key,pages,recursive'; |
| 34 | 34 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_feeds'] = 'pi_flexform'; |
| 35 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_feeds', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Feeds.xml'); |
|
| 35 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_feeds', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Feeds.xml'); |
|
| 36 | 36 | // Plugin "listview". |
| 37 | 37 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_listview'] = 'layout,select_key,pages,recursive'; |
| 38 | 38 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_listview'] = 'pi_flexform'; |
| 39 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_listview', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/ListView.xml'); |
|
| 39 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_listview', 'FILE:EXT:'.'dlf/Configuration/Flexforms/ListView.xml'); |
|
| 40 | 40 | // Plugin "metadata". |
| 41 | 41 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_metadata'] = 'layout,select_key,pages,recursive'; |
| 42 | 42 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_metadata'] = 'pi_flexform'; |
| 43 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_metadata', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Metadata.xml'); |
|
| 43 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_metadata', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Metadata.xml'); |
|
| 44 | 44 | // Plugin "navigation". |
| 45 | 45 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_navigation'] = 'layout,select_key,pages,recursive'; |
| 46 | 46 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_navigation'] = 'pi_flexform'; |
| 47 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_navigation', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Navigation.xml'); |
|
| 47 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_navigation', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Navigation.xml'); |
|
| 48 | 48 | // Plugin "oaipmh". |
| 49 | 49 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_oaipmh'] = 'layout,select_key,pages,recursive'; |
| 50 | 50 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_oaipmh'] = 'pi_flexform'; |
| 51 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_oaipmh', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/OaiPmh.xml'); |
|
| 51 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_oaipmh', 'FILE:EXT:'.'dlf/Configuration/Flexforms/OaiPmh.xml'); |
|
| 52 | 52 | // Plugin "pagegrid". |
| 53 | 53 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_pagegrid'] = 'layout,select_key,pages,recursive'; |
| 54 | 54 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_pagegrid'] = 'pi_flexform'; |
| 55 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pagegrid', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/PageGrid.xml'); |
|
| 55 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pagegrid', 'FILE:EXT:'.'dlf/Configuration/Flexforms/PageGrid.xml'); |
|
| 56 | 56 | // Plugin "pageview". |
| 57 | 57 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_pageview'] = 'layout,select_key,pages,recursive'; |
| 58 | 58 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_pageview'] = 'pi_flexform'; |
| 59 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pageview', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/PageView.xml'); |
|
| 59 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pageview', 'FILE:EXT:'.'dlf/Configuration/Flexforms/PageView.xml'); |
|
| 60 | 60 | // Plugin "search". |
| 61 | 61 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_search'] = 'layout,select_key,pages,recursive'; |
| 62 | 62 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_search'] = 'pi_flexform'; |
| 63 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_search', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Search.xml'); |
|
| 63 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_search', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Search.xml'); |
|
| 64 | 64 | // Plugin "statistics". |
| 65 | 65 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_statistics'] = 'layout,select_key,pages,recursive'; |
| 66 | 66 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_statistics'] = 'pi_flexform'; |
| 67 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_statistics', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Statistics.xml'); |
|
| 67 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_statistics', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Statistics.xml'); |
|
| 68 | 68 | // Plugin "tableofcontents". |
| 69 | 69 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_tableofcontents'] = 'layout,select_key,pages,recursive'; |
| 70 | 70 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_tableofcontents'] = 'pi_flexform'; |
| 71 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_tableofcontents', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/TableOfContents.xml'); |
|
| 71 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_tableofcontents', 'FILE:EXT:'.'dlf/Configuration/Flexforms/TableOfContents.xml'); |
|
| 72 | 72 | // Plugin "toolbox". |
| 73 | 73 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_toolbox'] = 'layout,select_key,pages,recursive'; |
| 74 | 74 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_toolbox'] = 'pi_flexform'; |
| 75 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_toolbox', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Toolbox.xml'); |
|
| 75 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_toolbox', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Toolbox.xml'); |
|
| 76 | 76 | |
| 77 | 77 | \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( |
| 78 | 78 | 'Kitodo.Dlf', |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | return [ |
| 5 | 5 | \Kitodo\Dlf\Domain\Model\ActionLog::class => [ |
@@ -249,6 +249,4 @@ |
||
| 249 | 249 | |
| 250 | 250 | $section->addTable($rows, $header); |
| 251 | 251 | } |
| 252 | - return $page; |
|
| 253 | - } |
|
| 254 | -} |
|
| 252 | + return $page |
|
| 255 | 253 | \ No newline at end of file |
@@ -249,6 +249,4 @@ |
||
| 249 | 249 | |
| 250 | 250 | $section->addTable($rows, $header); |
| 251 | 251 | } |
| 252 | - return $page; |
|
| 253 | - } |
|
| 254 | -} |
|
| 252 | + return $page |
|
| 255 | 253 | \ No newline at end of file |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | // There may be a single non-signifying space after the doc-comment asterisk, |
| 185 | 185 | // which is not included. |
| 186 | - $text .= preg_replace('#\\s*/?[*/]*\\s?(.*)$#', '$1', $line) . "\n"; |
|
| 186 | + $text .= preg_replace('#\\s*/?[*/]*\\s?(.*)$#', '$1', $line)."\n"; |
|
| 187 | 187 | } |
| 188 | 188 | $text = trim($text); |
| 189 | 189 | |
@@ -249,6 +249,4 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | $section->addTable($rows, $header); |
| 251 | 251 | } |
| 252 | - return $page; |
|
| 253 | - } |
|
| 254 | -} |
|
| 252 | + return $page |
|
| 255 | 253 | \ No newline at end of file |
@@ -32,8 +32,7 @@ discard block |
||
| 32 | 32 | * @subpackage dlf |
| 33 | 33 | * @access public |
| 34 | 34 | */ |
| 35 | -class Generator |
|
| 36 | -{ |
|
| 35 | +class Generator { |
|
| 37 | 36 | /** |
| 38 | 37 | * @var ObjectManager |
| 39 | 38 | */ |
@@ -49,8 +48,7 @@ discard block |
||
| 49 | 48 | */ |
| 50 | 49 | protected $dataMapper; |
| 51 | 50 | |
| 52 | - public function __construct() |
|
| 53 | - { |
|
| 51 | + public function __construct() { |
|
| 54 | 52 | $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
| 55 | 53 | $this->languageService = $this->objectManager->get(LanguageService::class); |
| 56 | 54 | $this->dataMapper = $this->objectManager->get(DataMapper::class); |
@@ -167,8 +165,7 @@ discard block |
||
| 167 | 165 | return $result; |
| 168 | 166 | } |
| 169 | 167 | |
| 170 | - protected function parseDocComment($docComment) |
|
| 171 | - { |
|
| 168 | + protected function parseDocComment($docComment) { |
|
| 172 | 169 | // TODO: Consider using phpDocumentor (though that splits the docblock into summary and description) |
| 173 | 170 | |
| 174 | 171 | // Adopted from DocCommentParser in TYPO3 v9 |
@@ -193,8 +190,7 @@ discard block |
||
| 193 | 190 | /** |
| 194 | 191 | * Transform table structure into .rst page. |
| 195 | 192 | */ |
| 196 | - public function generatePage(array $tables) |
|
| 197 | - { |
|
| 193 | + public function generatePage(array $tables) { |
|
| 198 | 194 | $page = new RstSection(); |
| 199 | 195 | $page->setHeader('Database Tables'); |
| 200 | 196 | $page->addText(<<<RST |
@@ -249,6 +245,4 @@ discard block |
||
| 249 | 245 | |
| 250 | 246 | $section->addTable($rows, $header); |
| 251 | 247 | } |
| 252 | - return $page; |
|
| 253 | - } |
|
| 254 | -} |
|
| 248 | + return $page |
|
| 255 | 249 | \ No newline at end of file |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | public function collectTables(): array |
| 64 | 64 | { |
| 65 | 65 | $sqlReader = $this->objectManager->get(SqlReader::class); |
| 66 | - $sqlCode = $sqlReader->getTablesDefinitionString(true); |
|
| 66 | + $sqlCode = $sqlReader->getTablesDefinitionString(TRUE); |
|
| 67 | 67 | $createTableStatements = $sqlReader->getCreateTableStatementArray($sqlCode); |
| 68 | 68 | |
| 69 | 69 | $tableToClassName = $this->getTableClassMap(); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | continue; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - $className = $tableToClassName[$tableName] ?? null; |
|
| 82 | + $className = $tableToClassName[$tableName] ?? NULL; |
|
| 83 | 83 | |
| 84 | 84 | $result[] = $this->getTableInfo($table, $className); |
| 85 | 85 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $isPrimary = []; |
| 121 | 121 | if (!is_null($primaryKey = $table->getPrimaryKey())) { |
| 122 | 122 | foreach ($primaryKey->getUnquotedColumns() as $primaryColumn) { |
| 123 | - $isPrimary[$primaryColumn] = true; |
|
| 123 | + $isPrimary[$primaryColumn] = TRUE; |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
@@ -141,21 +141,21 @@ discard block |
||
| 141 | 141 | $result = (object) [ |
| 142 | 142 | 'name' => $tableName, |
| 143 | 143 | 'columns' => $columns, |
| 144 | - 'modelClass' => null, |
|
| 144 | + 'modelClass' => NULL, |
|
| 145 | 145 | 'sqlComment' => $table->getComment() ?? '', |
| 146 | 146 | 'classComment' => '', |
| 147 | 147 | 'feComment' => $this->languageService->sL($GLOBALS['TCA'][$tableName]['ctrl']['title'] ?? ''), |
| 148 | 148 | ]; |
| 149 | 149 | |
| 150 | 150 | // Integrate doc-comments from model class and its fields |
| 151 | - if ($className !== null) { |
|
| 151 | + if ($className !== NULL) { |
|
| 152 | 152 | $reflection = new ReflectionClass($className); |
| 153 | 153 | |
| 154 | 154 | $dataMap = $this->dataMapper->getDataMap($className); |
| 155 | 155 | |
| 156 | 156 | foreach ($reflection->getProperties() as $property) { |
| 157 | 157 | $column = $dataMap->getColumnMap($property->getName()); |
| 158 | - if ($column !== null) { |
|
| 158 | + if ($column !== NULL) { |
|
| 159 | 159 | $result->columns[$column->getColumnName()]->fieldComment = $this->parseDocComment($property->getDocComment()); |
| 160 | 160 | } |
| 161 | 161 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $lines = explode("\n", $docComment); |
| 178 | 178 | foreach ($lines as $line) { |
| 179 | 179 | // Stop parsing at first tag |
| 180 | - if ($line !== '' && strpos($line, '@') !== false) { |
|
| 180 | + if ($line !== '' && strpos($line, '@') !== FALSE) { |
|
| 181 | 181 | break; |
| 182 | 182 | } |
| 183 | 183 | |
@@ -249,6 +249,4 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | $section->addTable($rows, $header); |
| 251 | 251 | } |
| 252 | - return $page; |
|
| 253 | - } |
|
| 254 | -} |
|
| 252 | + return $page |
|
| 255 | 253 | \ No newline at end of file |
@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | if (!empty($text)) { |
| 37 | 37 | if ($format['bold'] ?? false) { |
| 38 | - $text = '**' . $text . '**'; |
|
| 38 | + $text = '**'.$text.'**'; |
|
| 39 | 39 | } elseif ($format['italic'] ?? false) { |
| 40 | - $text = '*' . $text . '*'; |
|
| 40 | + $text = '*'.$text.'*'; |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | public static function paragraphs(array $paragraphs) |
| 48 | 48 | { |
| 49 | - $paragraphs = array_values(array_filter($paragraphs, function ($entry) { |
|
| 49 | + $paragraphs = array_values(array_filter($paragraphs, function($entry) { |
|
| 50 | 50 | return !empty($entry); |
| 51 | 51 | })); |
| 52 | 52 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | public function addText(string $text) |
| 69 | 69 | { |
| 70 | 70 | if (!empty($text)) { |
| 71 | - $this->text .= $text . "\n\n"; |
|
| 71 | + $this->text .= $text."\n\n"; |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
@@ -97,10 +97,10 @@ discard block |
||
| 97 | 97 | $numLines = count($valueLines); |
| 98 | 98 | for ($i = 0; $i < $numLines; $i++) { |
| 99 | 99 | $prefix = $i === 0 |
| 100 | - ? ' :' . $key . ':' |
|
| 100 | + ? ' :'.$key.':' |
|
| 101 | 101 | : ''; |
| 102 | 102 | |
| 103 | - $entry .= str_pad($prefix, 32) . trim($valueLines[$i]) . "\n"; |
|
| 103 | + $entry .= str_pad($prefix, 32).trim($valueLines[$i])."\n"; |
|
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
@@ -138,10 +138,10 @@ discard block |
||
| 138 | 138 | $headerSep = str_repeat($headerChar, mb_strlen($this->header)); |
| 139 | 139 | |
| 140 | 140 | if ($level === 0) { |
| 141 | - $result .= $headerSep . "\n"; |
|
| 141 | + $result .= $headerSep."\n"; |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - $result .= $this->header . "\n" . $headerSep . "\n\n"; |
|
| 144 | + $result .= $this->header."\n".$headerSep."\n\n"; |
|
| 145 | 145 | |
| 146 | 146 | return $result; |
| 147 | 147 | } |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * @subpackage dlf |
| 21 | 21 | * @access public |
| 22 | 22 | */ |
| 23 | -class RstSection |
|
| 24 | -{ |
|
| 23 | +class RstSection { |
|
| 25 | 24 | /** @var string */ |
| 26 | 25 | protected $header = ''; |
| 27 | 26 | |
@@ -31,8 +30,7 @@ discard block |
||
| 31 | 30 | /** @var RstSection[] */ |
| 32 | 31 | protected $subsections = []; |
| 33 | 32 | |
| 34 | - public static function format(string $text, array $format = []) |
|
| 35 | - { |
|
| 33 | + public static function format(string $text, array $format = []) { |
|
| 36 | 34 | if (!empty($text)) { |
| 37 | 35 | if ($format['bold'] ?? false) { |
| 38 | 36 | $text = '**' . $text . '**'; |
@@ -44,8 +42,7 @@ discard block |
||
| 44 | 42 | return $text; |
| 45 | 43 | } |
| 46 | 44 | |
| 47 | - public static function paragraphs(array $paragraphs) |
|
| 48 | - { |
|
| 45 | + public static function paragraphs(array $paragraphs) { |
|
| 49 | 46 | $paragraphs = array_values(array_filter($paragraphs, function ($entry) { |
| 50 | 47 | return !empty($entry); |
| 51 | 48 | })); |
@@ -53,27 +50,23 @@ discard block |
||
| 53 | 50 | return implode("\n\n", $paragraphs); |
| 54 | 51 | } |
| 55 | 52 | |
| 56 | - public function subsection() |
|
| 57 | - { |
|
| 53 | + public function subsection() { |
|
| 58 | 54 | $section = new static(); |
| 59 | 55 | $this->subsections[] = $section; |
| 60 | 56 | return $section; |
| 61 | 57 | } |
| 62 | 58 | |
| 63 | - public function setHeader(string $text) |
|
| 64 | - { |
|
| 59 | + public function setHeader(string $text) { |
|
| 65 | 60 | $this->header = $text; |
| 66 | 61 | } |
| 67 | 62 | |
| 68 | - public function addText(string $text) |
|
| 69 | - { |
|
| 63 | + public function addText(string $text) { |
|
| 70 | 64 | if (!empty($text)) { |
| 71 | 65 | $this->text .= $text . "\n\n"; |
| 72 | 66 | } |
| 73 | 67 | } |
| 74 | 68 | |
| 75 | - public function addTable(array $rows, array $headerRows) |
|
| 76 | - { |
|
| 69 | + public function addTable(array $rows, array $headerRows) { |
|
| 77 | 70 | $numHeaderRows = count($headerRows); |
| 78 | 71 | |
| 79 | 72 | $tableRst = <<<RST |
@@ -115,8 +108,7 @@ discard block |
||
| 115 | 108 | $this->addText($tableRst); |
| 116 | 109 | } |
| 117 | 110 | |
| 118 | - public function render(int $level = 0) |
|
| 119 | - { |
|
| 111 | + public function render(int $level = 0) { |
|
| 120 | 112 | $result = ''; |
| 121 | 113 | |
| 122 | 114 | $result .= $this->renderHeader($level); |
@@ -130,8 +122,7 @@ discard block |
||
| 130 | 122 | return $result; |
| 131 | 123 | } |
| 132 | 124 | |
| 133 | - protected function renderHeader(int $level) |
|
| 134 | - { |
|
| 125 | + protected function renderHeader(int $level) { |
|
| 135 | 126 | $result = ''; |
| 136 | 127 | |
| 137 | 128 | $headerChar = ['=', '=', '-', '~', '"'][$level]; |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | public static function format(string $text, array $format = []) |
| 35 | 35 | { |
| 36 | 36 | if (!empty($text)) { |
| 37 | - if ($format['bold'] ?? false) { |
|
| 37 | + if ($format['bold'] ?? FALSE) { |
|
| 38 | 38 | $text = '**' . $text . '**'; |
| 39 | - } elseif ($format['italic'] ?? false) { |
|
| 39 | + } elseif ($format['italic'] ?? FALSE) { |
|
| 40 | 40 | $text = '*' . $text . '*'; |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | :header-rows: $numHeaderRows |
| 82 | 82 | |
| 83 | 83 | |
| 84 | -RST; |
|
| 84 | +rst; |
|
| 85 | 85 | |
| 86 | 86 | // Pattern for a row: |
| 87 | 87 | // |
@@ -11,16 +11,16 @@ |
||
| 11 | 11 | * LICENSE.txt file that was distributed with this source code. |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -$classLoader = require_once __DIR__ . '/../../../vendor/autoload.php'; |
|
| 14 | +$classLoader = require_once __DIR__.'/../../../vendor/autoload.php'; |
|
| 15 | 15 | |
| 16 | 16 | $outputPath = $argv[1] ?? null; |
| 17 | 17 | if (empty($outputPath) || !is_writable(($outputPath))) { |
| 18 | - echo 'Error: Output path not specified or not writable' . "\n"; |
|
| 18 | + echo 'Error: Output path not specified or not writable'."\n"; |
|
| 19 | 19 | exit(1); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | -putenv('TYPO3_PATH_ROOT=' . __DIR__ . '/public'); |
|
| 23 | -putenv('TYPO3_PATH_APP=' . __DIR__); |
|
| 22 | +putenv('TYPO3_PATH_ROOT='.__DIR__.'/public'); |
|
| 23 | +putenv('TYPO3_PATH_APP='.__DIR__); |
|
| 24 | 24 | |
| 25 | 25 | // For compatibility with TYPO v9 |
| 26 | 26 | define('PATH_thisScript', __FILE__); |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | $classLoader = require_once __DIR__ . '/../../../vendor/autoload.php'; |
| 15 | 15 | |
| 16 | -$outputPath = $argv[1] ?? null; |
|
| 16 | +$outputPath = $argv[1] ?? NULL; |
|
| 17 | 17 | if (empty($outputPath) || !is_writable(($outputPath))) { |
| 18 | 18 | echo 'Error: Output path not specified or not writable' . "\n"; |
| 19 | 19 | exit(1); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | // For request types other than "FE", the configuration manager would try to access the database. |
| 29 | 29 | \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE); |
| 30 | -\TYPO3\CMS\Core\Core\Bootstrap::init($classLoader, false); |
|
| 30 | +\TYPO3\CMS\Core\Core\Bootstrap::init($classLoader, FALSE); |
|
| 31 | 31 | |
| 32 | 32 | $generator = new \Kitodo\DbDocs\Generator(); |
| 33 | 33 | $tables = $generator->collectTables(); |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $parameters = $request->getParsedBody(); |
| 46 | 46 | $solrCore = (string) $parameters['solrcore']; |
| 47 | 47 | $uHash = (string) $parameters['uHash']; |
| 48 | - if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) { |
|
| 48 | + if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) { |
|
| 49 | 49 | throw new \InvalidArgumentException('No valid parameter passed!', 1580585079); |
| 50 | 50 | } |
| 51 | 51 | // Perform Solr query. |
@@ -30,16 +30,14 @@ |
||
| 30 | 30 | * @subpackage dlf |
| 31 | 31 | * @access public |
| 32 | 32 | */ |
| 33 | -class SearchSuggest |
|
| 34 | -{ |
|
| 33 | +class SearchSuggest { |
|
| 35 | 34 | /** |
| 36 | 35 | * The main method of the eID script |
| 37 | 36 | * |
| 38 | 37 | * @param ServerRequestInterface $request |
| 39 | 38 | * @return ResponseInterface XML response of search suggestions |
| 40 | 39 | */ |
| 41 | - public function main(ServerRequestInterface $request) |
|
| 42 | - { |
|
| 40 | + public function main(ServerRequestInterface $request) { |
|
| 43 | 41 | $output = []; |
| 44 | 42 | // Get input parameters and decrypt core name. |
| 45 | 43 | $parameters = $request->getParsedBody(); |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $parameters = $request->getParsedBody(); |
| 46 | 46 | $solrCore = (string) $parameters['solrcore']; |
| 47 | 47 | $uHash = (string) $parameters['uHash']; |
| 48 | - if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) { |
|
| 48 | + if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === FALSE) { |
|
| 49 | 49 | throw new \InvalidArgumentException('No valid parameter passed!', 1580585079); |
| 50 | 50 | } |
| 51 | 51 | // Perform Solr query. |