[BUGFIX] Cache Identifiers shorten the MD5 hash 78/27878/2
authorMichiel Roos <michiel@maxserv.nl>
Wed, 26 Feb 2014 19:14:10 +0000 (20:14 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 4 Mar 2014 19:43:59 +0000 (20:43 +0100)
Cache Identifiers shorten the MD5 hash - This is superfluous substr() work
without any gain - remove it.

Change-Id: I0061337afb74df2f29aae69f868a1a0bbe3ad966
Resolves: #56313
Releases: 6.2
Reviewed-on: https://review.typo3.org/27878
Reviewed-by: Dmitry Dulepov
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/Package/PackageManager.php

index 41045e0..011e052 100644 (file)
@@ -147,7 +147,7 @@ class PackageManager extends \TYPO3\Flow\Package\PackageManager implements \TYPO
                if ($cacheIdentifier === NULL) {
                        // Create an artificial cache identifier if the package states file is not available yet
                        // in order that the class loader and class alias map can cache anyways.
-                       $cacheIdentifier = substr(md5(implode('###', array_keys($this->activePackages))), 0, 13);
+                       $cacheIdentifier = md5(implode('###', array_keys($this->activePackages)));
                }
                $this->classLoader->setCacheIdentifier($cacheIdentifier)->setPackages($this->activePackages);
 
@@ -164,7 +164,7 @@ class PackageManager extends \TYPO3\Flow\Package\PackageManager implements \TYPO
        protected function getCacheIdentifier() {
                if ($this->cacheIdentifier === NULL) {
                        if (@file_exists($this->packageStatesPathAndFilename)) {
-                               $this->cacheIdentifier = substr(md5_file($this->packageStatesPathAndFilename), 0, 13);
+                               $this->cacheIdentifier = md5_file($this->packageStatesPathAndFilename);
                        } else {
                                $this->cacheIdentifier = NULL;
                        }