Commit 24179415 authored by Benni Mack's avatar Benni Mack Committed by Georg Ringer
Browse files

[!!!][TASK] Remove deprecated code in EXT:core

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: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent c6141382
......@@ -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));
......
......@@ -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
......
......@@ -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;
......@@ -24,27 +23,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()
*
......
......@@ -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;
}
}
......
......@@ -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;
......
......@@ -1639,43 +1639,6 @@ class ResourceStorage implements ResourceStorageInterface
return $this->driver->getFileContents($file->getIdentifier());
}
/**
* 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
*
......
......@@ -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.
......
......@@ -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()`
......
......@@ -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'
],
],
];
Supports Markdown
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