[!!!][TASK] Remove deprecated code in EXT:core 35/59335/3
authorBenni Mack <benni@typo3.org>
Fri, 4 Jan 2019 20:17:58 +0000 (21:17 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 7 Jan 2019 08:06:45 +0000 (09:06 +0100)
The fallback in site configuration (during 9.3 and 9.4)
with all configuration within the subproperty
"site" is now removed.

- GraphicalFunctions->init()
- AbstractHierarchicalFilesystemDriver()->getCharsetConversion()
- FAL: FileExtensionFilter + Indexer - file extension + mimetype guessing
- ResourceStorage->dumpFileContents()
- AbstractService->devLog()

Resolves: #87342
Releases: master
Change-Id: I107544a129272ebace234e4e7e3ead0ff05a2e5c
Reviewed-on: https://review.typo3.org/59335
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Classes/Configuration/SiteConfiguration.php
typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
typo3/sysext/core/Classes/Resource/Driver/AbstractHierarchicalFilesystemDriver.php
typo3/sysext/core/Classes/Resource/Filter/FileExtensionFilter.php
typo3/sysext/core/Classes/Resource/Index/Indexer.php
typo3/sysext/core/Classes/Resource/ResourceStorage.php
typo3/sysext/core/Classes/Service/AbstractService.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php

index f8a5f62..30943d0 100644 (file)
@@ -110,13 +110,6 @@ class SiteConfiguration
             foreach ($finder as $fileInfo) {
                 $configuration = $loader->load(GeneralUtility::fixWindowsFilePath((string)$fileInfo));
                 $identifier = basename($fileInfo->getPath());
-                if (isset($configuration['site'])) {
-                    trigger_error(
-                        'Site configuration with key \'site\' has been deprecated, remove indentation level and site key.',
-                        E_USER_DEPRECATED
-                    );
-                    $configuration = $configuration['site'];
-                }
                 $siteConfiguration[$identifier] = $configuration;
             }
             $this->getCache()->set($this->cacheIdentifier, json_encode($siteConfiguration));
index a05f507..715312b 100644 (file)
@@ -345,53 +345,6 @@ class GraphicalFunctions
         $this->csConvObj = GeneralUtility::makeInstance(CharsetConverter::class);
     }
 
-    /**
-     * @deprecated will be removed in TYPO3 v10.0. As the constructor does everything directly
-     */
-    public function init()
-    {
-        trigger_error('GraphicalFunctions->init() will be removed in TYPO3 v10.0. Simply remove the call to the method, since this is now evaluted in the constructor.', E_USER_DEPRECATED);
-        $gfxConf = $GLOBALS['TYPO3_CONF_VARS']['GFX'];
-        if (function_exists('imagecreatefromjpeg') && function_exists('imagejpeg')) {
-            $this->gdlibExtensions[] = 'jpg';
-            $this->gdlibExtensions[] = 'jpeg';
-        }
-        if (function_exists('imagecreatefrompng') && function_exists('imagepng')) {
-            $this->gdlibExtensions[] = 'png';
-        }
-        if (function_exists('imagecreatefromgif') && function_exists('imagegif')) {
-            $this->gdlibExtensions[] = 'gif';
-        }
-
-        if ($gfxConf['processor_colorspace'] && in_array($gfxConf['processor_colorspace'], $this->allowedColorSpaceNames, true)) {
-            $this->colorspace = $gfxConf['processor_colorspace'];
-        }
-
-        $this->processorEnabled = (bool)$gfxConf['processor_enabled'];
-        // Setting default JPG parameters:
-        $this->jpegQuality = MathUtility::forceIntegerInRange($gfxConf['jpg_quality'], 10, 100, 85);
-        $this->addFrameSelection = (bool)$gfxConf['processor_allowFrameSelection'];
-        if ($gfxConf['gdlib_png']) {
-            $this->gifExtension = 'png';
-        }
-        $this->imageFileExt = GeneralUtility::trimExplode(',', $gfxConf['imagefile_ext']);
-
-        // Boolean. This is necessary if using ImageMagick 5+.
-        // Effects in Imagemagick 5+ tends to render very slowly!!
-        // - therefore must be disabled in order not to perform sharpen, blurring and such.
-        $this->cmds['jpg'] = $this->cmds['jpeg'] = '-colorspace ' . $this->colorspace . ' -quality ' . $this->jpegQuality;
-
-        // ... but if 'processor_effects' is set, enable effects
-        if ($gfxConf['processor_effects']) {
-            $this->processorEffectsEnabled = true;
-            $this->cmds['jpg'] .= $this->v5_sharpen(10);
-            $this->cmds['jpeg'] .= $this->v5_sharpen(10);
-        }
-        // Secures that images are not scaled up.
-        $this->mayScaleUp = (bool)$gfxConf['processor_allowUpscaling'];
-        $this->csConvObj = GeneralUtility::makeInstance(CharsetConverter::class);
-    }
-
     /*************************************************
      *
      * Layering images / "IMAGE" GIFBUILDER object
index e15710a..86ce671 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Core\Resource\Driver;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Charset\CharsetConverter;
 use TYPO3\CMS\Core\Resource\Exception\InvalidPathException;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\PathUtility;
@@ -25,27 +24,6 @@ use TYPO3\CMS\Core\Utility\PathUtility;
 abstract class AbstractHierarchicalFilesystemDriver extends AbstractDriver
 {
     /**
-     * @var CharsetConverter
-     * @deprecated instantiate CharsetConverter yourself in your driver implementation.
-     */
-    protected $charsetConversion;
-
-    /**
-     * Gets the charset conversion object.
-     *
-     * @return CharsetConverter
-     * @deprecated since TYPO3 v9.3, will be removed in TYPO3 v10.0.ß. Instantiate the CharsetConverter object yourself in your driver class.
-     */
-    protected function getCharsetConversion()
-    {
-        trigger_error('Shorthand method "getCharsetConversion()" within the FAL driver method will be removed in TYPO3 v10.0, instantiate CharsetConverter yourself.', E_USER_DEPRECATED);
-        if (!isset($this->charsetConversion)) {
-            $this->charsetConversion = GeneralUtility::makeInstance(CharsetConverter::class);
-        }
-        return $this->charsetConversion;
-    }
-
-    /**
      * Wrapper for \TYPO3\CMS\Core\Utility\GeneralUtility::validPathStr()
      *
      * @param string $theFile Filepath to evaluate
index 03f6052..f12119a 100644 (file)
@@ -19,7 +19,6 @@ use TYPO3\CMS\Core\Resource\Driver\DriverInterface;
 use TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\PathUtility;
 
 /**
  * Utility methods for filtering filenames
@@ -108,11 +107,7 @@ class FileExtensionFilter
             } catch (\InvalidArgumentException $e) {
                 $fileInfo = [];
             }
-            if (!isset($fileInfo['extension'])) {
-                trigger_error('Guessing FAL file extensions will be removed in TYPO3 v10.0. The FAL (' . get_class($driver) . ') driver method getFileInfoByIdentifier() should return the file extension.', E_USER_DEPRECATED);
-                $fileInfo['extension'] = PathUtility::pathinfo($itemIdentifier, PATHINFO_EXTENSION);
-            }
-            if (!$this->isAllowed($fileInfo['extension'])) {
+            if (!$this->isAllowed($fileInfo['extension'] ?? '')) {
                 $returnCode = -1;
             }
         }
index d3bbe49..e8d7f7f 100644 (file)
@@ -21,7 +21,6 @@ use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Resource\ResourceStorage;
 use TYPO3\CMS\Core\Type\File\ImageInfo;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\PathUtility;
 
 /**
  * The New FAL Indexer
@@ -316,10 +315,6 @@ class Indexer
         $fileInfo = $this->transformFromDriverFileInfoArrayToFileObjectFormat($fileInfo);
         $fileInfo['type'] = $this->getFileType($fileInfo['mime_type']);
         $fileInfo['sha1'] = $this->storage->hashFileByIdentifier($identifier, 'sha1');
-        if (!isset($fileInfo['extension'])) {
-            trigger_error('Guessing FAL file extensions will be removed in TYPO3 v10.0. The FAL (' . $this->storage->getDriverType() . ') driver method getFileInfoByIdentifier() should return the file extension.', E_USER_DEPRECATED);
-            $fileInfo['extension'] = PathUtility::pathinfo($fileInfo['name'], PATHINFO_EXTENSION);
-        }
         $fileInfo['missing'] = 0;
 
         return $fileInfo;
index 866dab7..abf8e66 100644 (file)
@@ -1640,43 +1640,6 @@ class ResourceStorage implements ResourceStorageInterface
     }
 
     /**
-     * Outputs file Contents,
-     * clears output buffer first and sends headers accordingly.
-     *
-     * @param FileInterface $file
-     * @param bool $asDownload If set Content-Disposition attachment is sent, inline otherwise
-     * @param string $alternativeFilename the filename for the download (if $asDownload is set)
-     * @param string $overrideMimeType If set this will be used as Content-Type header instead of the automatically detected mime type.
-     * @deprecated since TYPO3 v9.5, will be removed in TYPO3 v10.0.
-     */
-    public function dumpFileContents(FileInterface $file, $asDownload = false, $alternativeFilename = null, $overrideMimeType = null)
-    {
-        trigger_error('ResourceStorage->dumpFileContents() will be removed in TYPO3 v10.0. Use streamFile() instead.', E_USER_DEPRECATED);
-
-        $downloadName = $alternativeFilename ?: $file->getName();
-        $contentDisposition = $asDownload ? 'attachment' : 'inline';
-        header('Content-Disposition: ' . $contentDisposition . '; filename="' . $downloadName . '"');
-        header('Content-Type: ' . ($overrideMimeType ?: $file->getMimeType()));
-        header('Content-Length: ' . $file->getSize());
-
-        // Cache-Control header is needed here to solve an issue with browser IE8 and lower
-        // See for more information: http://support.microsoft.com/kb/323308
-        header("Cache-Control: ''");
-        header(
-            'Last-Modified: ' .
-            gmdate('D, d M Y H:i:s', array_pop($this->driver->getFileInfoByIdentifier($file->getIdentifier(), ['mtime']))) . ' GMT',
-            true,
-            200
-        );
-        ob_clean();
-        flush();
-        while (ob_get_level() > 0) {
-            ob_end_clean();
-        }
-        $this->driver->dumpFileContents($file->getIdentifier());
-    }
-
-    /**
      * Returns a PSR-7 Response which can be used to stream the requested file
      *
      * @param FileInterface $file
index aafad0a..b344616 100644 (file)
@@ -174,19 +174,6 @@ abstract class AbstractService implements LoggerAwareInterface
      *  Error handling
      *
      ***************************************/
-    /**
-     * Logs debug messages to the Logging API
-     *
-     * @param string $msg Debug message
-     * @param int $severity Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message
-     * @param array|bool $dataVar additional data you want to pass to the logger.
-     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
-     */
-    public function devLog($msg, $severity = 0, $dataVar = false)
-    {
-        trigger_error('AbstractService->devLog() will be removed with TYPO3 v10.0.', E_USER_DEPRECATED);
-        $this->logger->debug($this->info['serviceKey'] . ': ' . $msg, (array)$dataVar);
-    }
 
     /**
      * Puts an error on the error stack. Calling without parameter adds a general error.
index a223457..1a913d1 100644 (file)
@@ -279,15 +279,19 @@ The following PHP class methods that have been previously deprecated for v9 have
 * :php:`TYPO3\CMS\Core\Crypto\PasswordHashing\PhpassPasswordHash->setHashCount()`
 * :php:`TYPO3\CMS\Core\Crypto\PasswordHashing\PhpassPasswordHash->setMaxHashCount()`
 * :php:`TYPO3\CMS\Core\Crypto\PasswordHashing\PhpassPasswordHash->setMinHashCount()`
+* :php:`TYPO3\CMS\Core\Imaging\GraphicalFunctions->init()`
 * :php:`TYPO3\CMS\Core\Html\RteHtmlParser->transformStyledATags()`
 * :php:`TYPO3\CMS\Core\Html\RteHtmlParser->TS_links_rte()`
 * :php:`TYPO3\CMS\Core\Html\RteHtmlParser->urlInfoForLinkTags()`
 * :php:`TYPO3\CMS\Core\Package\PackageManager->injectDependencyResolver()`
-* :php:`TYPO3\CMS\Core\Page\PageRenderer::addMetaTag()`
-* :php:`TYPO3\CMS\Core\Page\PageRenderer::disableConcatenateFiles()`
-* :php:`TYPO3\CMS\Core\Page\PageRenderer::enableConcatenateFiles()`
-* :php:`TYPO3\CMS\Core\Page\PageRenderer::getConcatenateFiles()`
-* :php:`TYPO3\CMS\Core\Page\PageRenderer::loadJquery()`
+* :php:`TYPO3\CMS\Core\Page\PageRenderer->addMetaTag()`
+* :php:`TYPO3\CMS\Core\Page\PageRenderer->disableConcatenateFiles()`
+* :php:`TYPO3\CMS\Core\Page\PageRenderer->enableConcatenateFiles()`
+* :php:`TYPO3\CMS\Core\Page\PageRenderer->getConcatenateFiles()`
+* :php:`TYPO3\CMS\Core\Page\PageRenderer->loadJquery()`
+* :php:`TYPO3\CMS\Core\Resource\Driver\AbstractHierarchicalFilesystemDriver->getCharsetConversion()`
+* :php:`TYPO3\CMS\Core\Resource\ResourceStorage->dumpFileContents()`
+* :php:`TYPO3\CMS\Core\Service\AbstractService->devLog()`
 * :php:`TYPO3\CMS\Core\TypoScript\TemplateService->getFileName()`
 * :php:`TYPO3\CMS\Core\TypoScript\TemplateService->getFromMPmap()`
 * :php:`TYPO3\CMS\Core\TypoScript\TemplateService->init()`
index 1a45bee..38cc06f 100644 (file)
@@ -1470,6 +1470,7 @@ return [
         'maximumNumberOfArguments' => 3,
         'restFiles' => [
             'Deprecation-52694-DeprecatedGeneralUtilitydevLog.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst'
         ],
     ],
     'TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->sendRedirect' => [
@@ -4061,7 +4062,8 @@ return [
         'numberOfMandatoryArguments' => 1,
         'maximumNumberOfArguments' => 4,
         'restFiles' => [
-            'Deprecation-83793-FALResourceStorage-dumpFileContents.rst'
+            'Deprecation-83793-FALResourceStorage-dumpFileContents.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst'
         ],
     ],
     'TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->processOutput' => [
@@ -4072,4 +4074,11 @@ return [
             'Breaking-87193-DeprecatedFunctionalityRemoved.rst'
         ],
     ],
+    'TYPO3\CMS\Core\Imaging\GraphicalFunctions->init' => [
+        'numberOfMandatoryArguments' => 0,
+        'maximumNumberOfArguments' => 0,
+        'restFiles' => [
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst'
+        ],
+    ],
 ];