forked from emersonfaria/ExpressoLivre3
/
Message.php
59 lines (55 loc) · 1.36 KB
/
Message.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Tine 2.0
*
* @package Felamimail
* @subpackage Controller
* @license http://www.gnu.org/licenses/agpl.html AGPL Version 3
* @author Philipp Schüle <p.schuele@metaways.de>
* @copyright Copyright (c) 2009-2011 Metaways Infosystems GmbH (http://www.metaways.de)
*/
/**
* cache controller for Felamimail messages
*
* @package Felamimail
* @subpackage Controller
*/
class Felamimail_Controller_Cache_Message
{
/**
* holds the instance of the singleton
*
* @var Felamimail_Controller_Cache_Message
*/
private static $_instance = NULL;
/**
* the constructor
*
* don't use the constructor. use the singleton
*/
private function __construct()
{
}
/**
* don't clone. Use the singleton.
*
*/
private function __clone()
{
}
/**
* the singleton pattern
*
* @return Felamimail_Controller_Cache_Message
*/
public static function getInstance()
{
if (self::$_instance === NULL) {
$adapter = Tinebase_Core::getConfig()->messagecache;
$adapter = (empty($adapter))?'sql':$adapter;
$classname = 'Felamimail_Controller_Cache_' . ucfirst($adapter) . '_Message';
self::$_instance = $classname::getInstance();
}
return self::$_instance;
}
}