pluf2

pluf2 Commit Details


Date:2008-11-24 11:37:02 (16 years 27 days ago)
Author:Loic d'Anterroches
Branch:master
Commit:3cc4430c3fc75291bf55768c832d586fd5cb7f02
Parents: f1e66cd6feffcc933b8fa05f0b10168cf2b08c6d
Message:Added a registry to avoid cache object duplication.

Changes:

File differences

src/Pluf/Cache.php
5757
5858
5959
60
60
61
62
63
6164
6265
6366
if (false == ($engine = Pluf::f('cache_engine', false))) {
throw new Pluf_Exception_SettingError('"cache_engine" setting not defined.');
}
return new $engine();
if (!isset($GLOBALS['_PX_Pluf_Cache-'.$engine])) {
$GLOBALS['_PX_Pluf_Cache-'.$engine] = new $engine();
}
return $GLOBALS['_PX_Pluf_Cache-'.$engine];
}
/**
src/Pluf/Cache/File.php
2929
3030
3131
32
32
3333
3434
3535
*/
class Pluf_Cache_File extends Pluf_Cache
{
public function __constructor()
public function __construct()
{
if (false == Pluf::f('cache_file_folder', false)) {
throw new Pluf_Exception_SettingError('"cache_file_folder" setting not defined.');
src/Pluf/Cache/Memcached.php
4242
4343
4444
45
45
4646
4747
4848
49
49
5050
5151
5252
private $memcache = null;
private $keyprefix = '';
public function __constructor()
public function __construct()
{
$this->memcache = memcache_connect(Pluf::f('cache_memcached_server', 'localhost'),
Pluf::f('cache_memcached_port', 11211));
if (false == $this->memcache) {
if (false === $this->memcache) {
$this->memcache = null;
}
$this->keyprefix = Pluf::f('cache_memcached_keyprefix', '');

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.06240s using 13 queries.