[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [websites/season-kde-org] classes: Determine cache availability based on write access to cache folde
From:       Sayak Banerjee <sayakb () kde ! org>
Date:       2012-07-08 13:09:17
Message-ID: 20120708130917.11327A6094 () git ! kde ! org
[Download RAW message or body]

Git commit 22eb37f809c52cd631588aee06cec5ecbb1dc435 by Sayak Banerjee.
Committed on 08/07/2012 at 15:09.
Pushed by sayakb into branch 'master'.

Determine cache availability based on write access to cache folder as well

M  +4    -2    classes/class_cache.php

http://commits.kde.org/websites/season-kde-org/22eb37f809c52cd631588aee06cec5ecbb1dc435

diff --git a/classes/class_cache.php b/classes/class_cache.php
index 85b4850..b329efb 100755
--- a/classes/class_cache.php
+++ b/classes/class_cache.php
@@ -22,16 +22,18 @@ class cache
 
         if (class_exists('Cache_Lite'))
         {
+            $cache_path = realpath('./cache') . '/';
+            
             // Set the caching options
             $options = array(
-                'cacheDir'               => realpath('./cache') . '/',
+                'cacheDir'               => $cache_path,
                 'lifeTime'               => 7200,
                 'automaticSerialization' => true,
             );
 
             // Inistantiate the cache objects
             $this->lite = new Cache_Lite($options);
-            $this->is_available = !@PEAR::isError($this->lite);
+            $this->is_available = !@PEAR::isError($this->lite) && is_writable($cache_path);
         }
         else
         {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic