aliroSimpleCache Class Reference

Inheritance diagram for aliroSimpleCache:

aliroBasicCache aliroCache

List of all members.

Public Member Functions

 __construct ($group)
 clean ()
 get ($id)
 save ($data, $id=null)

Protected Member Functions

 getGroupPath ()
 getCachePath ($name)
 encodeID ($id)

Protected Attributes

 $group = ''
 $idencoded = ''
 $caching = true
 $timeout = _ALIRO_HTML_CACHE_TIME_LIMIT
 $sizelimit = _ALIRO_HTML_CACHE_SIZE_LIMIT
 $livesite = ''


Detailed Description

Definition at line 41 of file aliroCache.php.


Constructor & Destructor Documentation

aliroSimpleCache::__construct ( group  ) 

Reimplemented in aliroCache.

Definition at line 49 of file aliroCache.php.

References $group.

00049                                          {
00050         if ($group) $this->group = $group;
00051         else trigger_error ('Cannot create cache without specifying group name');
00052         parent::__construct();
00053     }


Member Function Documentation

aliroSimpleCache::getGroupPath (  )  [protected]

Definition at line 55 of file aliroCache.php.

References aliroFileManager::getInstance().

Referenced by clean(), and getCachePath().

00055                                        {
00056         $grouppath = $this->basepath."html/$this->group/";
00057         if (!file_exists($grouppath)) aliroFileManager::getInstance()->createDirectory ($grouppath);
00058         return $grouppath;
00059     }

aliroSimpleCache::getCachePath ( name  )  [protected]

Reimplemented from aliroBasicCache.

Definition at line 61 of file aliroCache.php.

References getGroupPath().

00061                                             {
00062         return $this->getGroupPath().$name;
00063     }

aliroSimpleCache::clean (  ) 

Definition at line 65 of file aliroCache.php.

References getGroupPath().

00065                              {
00066         $path = $this->getGroupPath();
00067         $dir = new aliroDirectory($path);
00068         $dir->deleteFiles();
00069     }

aliroSimpleCache::get ( id  ) 

Definition at line 71 of file aliroCache.php.

References encodeID(), and aliroBasicCache::retrieve().

00071                               {
00072         $this->idencoded = $this->encodeID($id);
00073         return $this->retrieve ($this->idencoded);
00074     }

aliroSimpleCache::save ( data,
id = null 
)

Definition at line 76 of file aliroCache.php.

References encodeID(), and aliroBasicCache::store().

Referenced by aliroCache::call().

00076                                            {
00077         if ($id) $this->idencoded = $this->encodeID($id);
00078         return $this->store ($data, $this->idencoded);
00079     }

aliroSimpleCache::encodeID ( id  )  [protected]

Definition at line 81 of file aliroCache.php.

Referenced by get(), and save().

00081                                       {
00082         return md5(serialize($id).$this->livesite);
00083     }


Member Data Documentation

aliroSimpleCache::$group = '' [protected]

Definition at line 42 of file aliroCache.php.

Referenced by aliroCache::__construct(), and __construct().

aliroSimpleCache::$idencoded = '' [protected]

Definition at line 43 of file aliroCache.php.

aliroSimpleCache::$caching = true [protected]

Definition at line 44 of file aliroCache.php.

aliroSimpleCache::$timeout = _ALIRO_HTML_CACHE_TIME_LIMIT [protected]

Reimplemented from aliroBasicCache.

Definition at line 45 of file aliroCache.php.

aliroSimpleCache::$sizelimit = _ALIRO_HTML_CACHE_SIZE_LIMIT [protected]

Reimplemented from aliroBasicCache.

Definition at line 46 of file aliroCache.php.

aliroSimpleCache::$livesite = '' [protected]

Definition at line 47 of file aliroCache.php.


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

Generated on Wed May 14 13:02:00 2008 for ALIRO by  doxygen 1.5.5