[TASK] Improve classLoader compatibility for Windows systems 22/24722/2
authorNicole Cordes <typo3@cordes.co>
Mon, 14 Oct 2013 08:23:42 +0000 (10:23 +0200)
committerNicole Cordes <typo3@cordes.co>
Mon, 14 Oct 2013 09:38:23 +0000 (11:38 +0200)
On Windows systems the (absolute) paths are different to unix ones. The
core already provides functions to catch both cases in different checks.
This patch enables the use of those functions in classLoader.

Resolves: #52774
Releases: 6.2
Change-Id: I7dd4b2f7a88b07281222995a58962deeb27e8869
Reviewed-on: https://review.typo3.org/24722
Reviewed-by: Wouter Wolters
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes
typo3/sysext/core/Classes/Cache/Backend/ClassLoaderBackend.php

index 72b0f6b..fe18921 100755 (executable)
@@ -60,11 +60,11 @@ class ClassLoaderBackend extends SimpleFileBackend {
                if ($entryIdentifier !== basename($entryIdentifier)) {
                        throw new \InvalidArgumentException('The specified entry identifier (' . $entryIdentifier . ') must not contain a path segment.', 1364205166);
                }
-               if ($filePath[0] === '/' && \TYPO3\CMS\Core\Utility\GeneralUtility::isAllowedAbsPath($filePath)) {
+               if (\TYPO3\CMS\Core\Utility\GeneralUtility::isAllowedAbsPath($filePath)) {
                        // Make relative if absolute to prevent wrong entries if the whole installation is moved or copied
                        $filePath = \TYPO3\CMS\Core\Utility\PathUtility::getRelativePath($this->cacheDirectory, dirname($filePath)) . basename($filePath);
                }
-               if ($filePath[0] === '/') {
+               if (PathUtility::isAbsolutePath($filePath)) {
                        $this->set($entryIdentifier, '<?php require \'' . $filePath . '\';');
                } else {
                        $this->set($entryIdentifier, '<?php require __DIR__ . \'/' . $filePath . '\';');