[pLog-svn] r1696 - plog/branches/plog-1.1-ben/class/cache

ork at devel.plogworld.net ork at devel.plogworld.net
Mon Apr 4 16:33:06 GMT 2005


Author: ork
Date: 2005-04-04 16:33:05 +0000 (Mon, 04 Apr 2005)
New Revision: 1696

Modified:
   plog/branches/plog-1.1-ben/class/cache/cachemanager.class.php
Log:
read temp_dir instead of hardcoded /tmp/ dir.. 


Modified: plog/branches/plog-1.1-ben/class/cache/cachemanager.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/cache/cachemanager.class.php	2005-04-04 16:25:26 UTC (rev 1695)
+++ plog/branches/plog-1.1-ben/class/cache/cachemanager.class.php	2005-04-04 16:33:05 UTC (rev 1696)
@@ -2,6 +2,7 @@
 
     require_once( PLOG_CLASS_PATH . "class/object/object.class.php" );
 
+
     define( "CACHE_GLOBAL",          "pLog" );
     define( "CACHE_LOCALES",         "locales" );
     define( "CACHE_BLOGINFOS",       "bloginfo" );
@@ -32,19 +33,22 @@
             static $cache;
 
             if( $cache == null ) {
-            // source the neccessary files
-            require_once( PLOG_CLASS_PATH . "class/cache/cache.class.php" );
+                // source the neccessary files
+                require_once( PLOG_CLASS_PATH . "class/cache/cache.class.php" );
+                require_once( PLOG_CLASS_PATH . "class/config/config.class.php" );
 
-            // define defaults
-            $cacheParameter = array(
-                'cacheDir' => '/tmp/cache/',
-                'caching'  => true,
-                'fileLocking' => true,
-                'writeControl' => true,
-                'readControl' => false,
-                'automaticSerialization' => true,
-                'hashedDirectoryLevel' => 2 );
+                $temp_dir = Config::getTmpFolder() ;
 
+                // define defaults
+                $cacheParameter = array(
+                    'cacheDir' => $temp_dir;
+                    'caching'  => true,
+                    'fileLocking' => true,
+                    'writeControl' => true,
+                    'readControl' => false,
+                    'automaticSerialization' => true,
+                    'hashedDirectoryLevel' => 2 );
+
                 // build a new cache object
                 $cache =& new Cache( $cacheParameter);
             }




More information about the pLog-svn mailing list