Fixed bug #10689: FileCache doesn't work on windows
authorSteffen Kamper <info@sk-typo3.de>
Sun, 7 Jun 2009 22:06:31 +0000 (22:06 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Sun, 7 Jun 2009 22:06:31 +0000 (22:06 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5568 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/cache/backend/class.t3lib_cache_backend_filebackend.php

index b152771..374d811 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-06-08  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #10689: FileCache doesn't work on windows
        * Fixed bug #10741: Create version of page crashes in Cache caused by "-" in const PATTERN_ENTRYIDENTIFIER
 
 2009-06-07  Rupert Germann  <rupi@gmx.li>
index 84e5113..cb01ae0 100644 (file)
@@ -45,6 +45,8 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
         */
        protected $cacheDirectory = '';
 
+       protected $root = '/';
+       
        /**
         * Constructs this backend
         *
@@ -52,7 +54,9 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
         */
        public function __construct(array $options = array()) {
                parent::__construct($options);
-
+       if (TYPO3_OS === 'WIN') {
+               $this->root = '';
+       }
                if (empty($this->cacheDirectory)) {
                        $cacheDirectory = 'typo3temp/cache/';
                        try {
@@ -171,7 +175,7 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
                if (!is_writable($cacheEntryPath)) {
                        try {
                                t3lib_div::mkdir_deep(
-                                       '/',
+                                       $this->root,
                                        $cacheEntryPath
                                );
                        } catch(Exception $exception) {
@@ -219,7 +223,7 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
 
                        if (!is_writable($tagPath)) {
                                t3lib_div::mkdir_deep(
-                                       '/',
+                                       $this->root,
                                        $tagPath
                                );
                        }