CacheLib Class Reference

Mise en cache de libraririe et class. More...

List of all members.

Static Public Member Functions

Protected Member Functions

Static Protected Attributes


Detailed Description

Mise en cache de libraririe et class.

Definition at line 15 of file osCSS_CacheLib.php.


Constructor & Destructor Documentation

CacheLib::__construct (  )  [protected]

Definition at line 23 of file osCSS_CacheLib.php.

00023                                   {
00024     self::$cache_key = null;
00025     self::$folder=(defined('DIR_WS_ADMIN')? DIR_FS_ADMIN.DIR_WS_INCLUDES.'tmp/cache/' : DIR_FS_WORK);
00026   }


Member Function Documentation

static CacheLib::addfiles ( file = array()  )  [static]

Definition at line 46 of file osCSS_CacheLib.php.

Referenced by oscss_plugins::active_plugins().

00046                                                 {
00047     $filename = self::$folder . self::$cache_key . '.cache';
00048 
00049     $fp=fopen($filename,'w');
00050     flock($fp, 2); // LOCK_EX
00051     foreach($file as $item) {
00052       if(file_exists($item))fputs($fp, file_get_contents($item));
00053     }
00054     flock($fp, 3); // LOCK_UN
00055     fclose($fp);
00056   }

static CacheLib::getfilecache (  )  [static]

Definition at line 58 of file osCSS_CacheLib.php.

Referenced by oscss_plugins::active_plugins().

00058                                        {
00059     return  self::$folder . self::$cache_key . '.cache';
00060   }

static CacheLib::read ( key,
expire = 0 
) [static]

Definition at line 28 of file osCSS_CacheLib.php.

Referenced by oscss_plugins::active_plugins().

00028                                                  {
00029     self::$_instance = new self();
00030 
00031     self::$cache_key = $key;
00032 
00033     $filename = self::$folder . $key . '.cache';
00034 
00035     if (file_exists($filename) && (OSCSS_DEBUG == false) ) {
00036       $difference = floor((time() - filemtime($filename)) / 60);
00037 
00038       if ( ($expire == '0') || ($difference < $expire) ) {
00039         return true;
00040       }
00041     }
00042 
00043     return false;
00044   }


Member Data Documentation

CacheLib::$_instance [static, protected]

Definition at line 19 of file osCSS_CacheLib.php.

CacheLib::$cache_key [static, protected]

Definition at line 17 of file osCSS_CacheLib.php.

CacheLib::$folder [static, protected]

Definition at line 21 of file osCSS_CacheLib.php.


The documentation for this class was generated from the following file: