[!!!][TASK] Remove feature enable_typo3temp_db_tracking 34/36434/5
authorBenjamin Mack <benni@typo3.org>
Fri, 30 Jan 2015 14:50:06 +0000 (15:50 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 30 Jan 2015 16:23:29 +0000 (17:23 +0100)
The functionality for enabling the tracking
of the files within typo3temp/ created by
GraphicalFunctions and its according
DB table have been removed.

The according option
$TYPO3_CONF_VARS[GFX][enable_typo3temp_db_tracking]
has been removed.

Resolves: #64643
Releases: master
Change-Id: I3ef1a7de7246ea6090a83efbda93d73bd39a8892
Reviewed-on: http://review.typo3.org/36434
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-64643-RemoveEnableTypo3tempDbTracking.rst [new file with mode: 0644]
typo3/sysext/frontend/ext_tables.sql
typo3/sysext/install/Classes/Controller/Action/Tool/CleanUp.php
typo3/sysext/install/Classes/Controller/Action/Tool/TestSetup.php
typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php

index 28e8e2d..a8d0dab 100644 (file)
@@ -105,15 +105,6 @@ class GraphicalFunctions {
        public $truecolorColors = 16777215;
 
        /**
-        * If set, then all files in typo3temp will be logged in a database table.
-        * In addition to being a log of the files with original filenames,
-        * it also serves to secure that the same image is not rendered simultaneously by two different processes.
-        *
-        * @var bool
-        */
-       public $enable_typo3temp_db_tracking = 0;
-
-       /**
         * Commalist of file extensions perceived as images by TYPO3.
         * List should be set to 'gif,png,jpeg,jpg' if IM is not available. Lowercase and no spaces between!
         *
@@ -346,9 +337,6 @@ class GraphicalFunctions {
                if ($gfxConf['gdlib_png']) {
                        $this->gifExtension = 'png';
                }
-               if ($gfxConf['enable_typo3temp_db_tracking']) {
-                       $this->enable_typo3temp_db_tracking = $gfxConf['enable_typo3temp_db_tracking'];
-               }
                $this->imageFileExt = $gfxConf['imagefile_ext'];
 
                // Boolean. This is necessary if using ImageMagick 5+.
@@ -2242,7 +2230,7 @@ class GraphicalFunctions {
                                $output = $this->absPrefix . $this->tempPath . 'pics/' . $this->filenamePrefix . $theOutputName . '.' . $newExt;
                                // Register temporary filename:
                                $GLOBALS['TEMP_IMAGES_ON_PAGE'][] = $output;
-                               if ($this->dontCheckForExistingTempFile || !$this->file_exists_typo3temp_file($output, $imagefile)) {
+                               if ($this->dontCheckForExistingTempFile || !file_exists($output)) {
                                        $this->imageMagickExec($imagefile, $output, $command, $frame);
                                }
                                if (file_exists($output)) {
@@ -2468,56 +2456,6 @@ class GraphicalFunctions {
                return $out;
        }
 
-       /**
-        * Used to check if a certain process of scaling an image is already being carried out (can be logged in the SQL database)
-        *
-        * @param string $output Output imagefile
-        * @param string $orig Original basis file
-        * @return bool Returns TRUE if the file is already being made; thus "TRUE" means "Don't render the image again
-        * @access private
-        */
-       public function file_exists_typo3temp_file($output, $orig = '') {
-               if ($this->enable_typo3temp_db_tracking) {
-                       // If file exists, then we return immediately
-                       if (file_exists($output)) {
-                               return 1;
-                       } else {
-                               // If not, we look up in the cache_typo3temp_log table to see if there is a image being rendered right now.
-                               $md5Hash = md5($output);
-                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('md5hash', 'cache_typo3temp_log', 'md5hash=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($md5Hash, 'cache_typo3temp_log') . ' AND tstamp>' . ($GLOBALS['EXEC_TIME'] - 30));
-                               // If there was a record, the image is being generated by another process (we assume)
-                               if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
-                                       if (is_object($GLOBALS['TSFE'])) {
-                                               $GLOBALS['TSFE']->set_no_cache('Another process renders this file now: ' . $output);
-                                       }
-                                       // ...so we set no_cache, because we dont want this page (which will NOT display an image...!) to be cached! (Only a page with the correct image on...)
-                                       if (is_object($GLOBALS['TT'])) {
-                                               $GLOBALS['TT']->setTSlogMessage('typo3temp_log: Assume this file is being rendered now: ' . $output);
-                                       }
-                                       // Return 'success - 2'
-                                       return 2;
-                               } else {
-                                       // If the current time is more than 30 seconds since this record was written, we clear the record, write a new and render the image.
-                                       $insertFields = array(
-                                               'md5hash' => $md5Hash,
-                                               'tstamp' => $GLOBALS['EXEC_TIME'],
-                                               'filename' => $output,
-                                               'orig_filename' => $orig
-                                       );
-                                       $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_typo3temp_log', 'md5hash=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($md5Hash, 'cache_typo3temp_log'));
-                                       $GLOBALS['TYPO3_DB']->exec_INSERTquery('cache_typo3temp_log', $insertFields);
-                                       if (is_object($GLOBALS['TT'])) {
-                                               $GLOBALS['TT']->setTSlogMessage('typo3temp_log: The row did not exist, so a new is written and file is being processed: ' . $output);
-                                       }
-                                       return 0;
-                               }
-                       }
-               } else {
-                       return file_exists($output);
-               }
-       }
-
        /***********************************
         *
         * ImageMagick API functions
index ed5d189..cdd0e89 100644 (file)
@@ -39,7 +39,6 @@ return array(
                'im_stripProfileCommand' => '+profile \'*\'',   // String: Specify the command to strip the profile information, which can reduce thumbnail size up to 60KB. Command can differ in IM/GM, IM also know the -strip command. See <a href="http://www.imagemagick.org/Usage/thumbnails/#profiles" target="_blank">imagemagick.org</a> for details
                'im_useStripProfileByDefault' => TRUE,                  // Boolean: If set, the im_stripProfileCommand is used with all IM Image operations by default. See tsRef for setting this parameter explocit for IMAGE generation.
                'jpg_quality' => 70,                                                    // Integer: Default JPEG generation quality
-               'enable_typo3temp_db_tracking' => FALSE,                // Boolean: If set, then all files in typo3temp will be logged in a database table. In addition to being a log of the files with original filenames, it also serves to secure that the same image is not rendered simultaneously by two different processes.
                'TTFdpi' => 96,                                                                 // Integer: Enter how many dpi the FreeType module uses. Freetype1 should be set to 72. Freetype2 should be set to 96 (otherwise fonts are rendered way bigger than FreeType1). This works as a global scaling factor for Freetype.
                'png_truecolor' => TRUE,
                'colorspace' => 'RGB',                                                  // String: Specifiy the colorspace to use. Some ImageMagick versions (like 6.7.0 and above) use the sRGB colorspace, so all images are darker then the original. <br />Possible Values: CMY, CMYK, Gray, HCL, HSB, HSL, HWB, Lab, LCH, LMS, Log, Luv, OHTA, Rec601Luma, Rec601YCbCr, Rec709Luma, Rec709YCbCr, RGB, sRGB, Transparent, XYZ, YCbCr, YCC, YIQ, YCbCr, YUV
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-64643-RemoveEnableTypo3tempDbTracking.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-64643-RemoveEnableTypo3tempDbTracking.rst
new file mode 100644 (file)
index 0000000..d88b9e5
--- /dev/null
@@ -0,0 +1,29 @@
+========================================================================
+Breaking: #64643 - Remove functionality for enable_typo3temp_db_tracking
+========================================================================
+
+Description
+===========
+
+The logic and the database table for tracking generated typo3temp/ images by GraphicalFunctions has been removed
+without substitution. The option to enable this functionality $TYPO3_CONF_VARS[GFX][enable_typo3temp_db_tracking]
+has been removed.
+
+
+Impact
+======
+
+Images generated with GraphicalFunctions with the option above enabled will not be tracked in the database anymore.
+
+
+Affected installations
+======================
+
+Any installation having the option $TYPO3_CONF_VARS[GFX][enable_typo3temp_db_tracking] enabled.
+
+
+Migration
+=========
+
+If the functionality or a similar functionality is needed for some edge-cases, an own implementation via a third-party
+extension is needed.
index 240ec7e..1670582 100644 (file)
@@ -1,16 +1,4 @@
 #
-# Table structure for table 'cache_typo3temp_log'
-#
-CREATE TABLE cache_typo3temp_log (
-       md5hash varchar(32) DEFAULT '' NOT NULL,
-       tstamp int(11) DEFAULT '0' NOT NULL,
-       filename varchar(255) DEFAULT '' NOT NULL,
-       orig_filename varchar(255) DEFAULT '' NOT NULL,
-
-       PRIMARY KEY (md5hash)
-) ENGINE=InnoDB;
-
-#
 # Table structure for table 'cache_md5params'
 #
 CREATE TABLE cache_md5params (
index 49c291a..64c4a47 100644 (file)
@@ -71,10 +71,6 @@ class CleanUp extends Action\AbstractAction {
                                'description' => 'Frontend redirects',
                        ),
                        array(
-                               'name' => 'cache_typo3temp_log',
-                               'description' => 'Image rendering lock information',
-                       ),
-                       array(
                                'name' => 'fe_sessions',
                                'description' => 'Frontend user sessions',
                        ),
index 3923406..237effb 100644 (file)
@@ -642,7 +642,6 @@ class TestSetup extends Action\AbstractAction {
                $imageProcessor->init();
                $imageProcessor->tempPath = PATH_site . 'typo3temp/';
                $imageProcessor->dontCheckForExistingTempFile = 1;
-               $imageProcessor->enable_typo3temp_db_tracking = 0;
                $imageProcessor->filenamePrefix = 'installTool-';
                $imageProcessor->dontCompress = 1;
                $imageProcessor->alternativeOutputKey = 'typo3InstallTest';
index e11085d..5d7221d 100644 (file)
@@ -71,7 +71,9 @@ class SilentConfigurationUpgradeService {
                // #64226
                'BE/accessListRenderMode',
                // #24900
-               'SYS/compat_version'
+               'SYS/compat_version',
+               // #64643
+               'GFX/enable_typo3temp_db_tracking'
        );
 
        /**