MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
XcacheCache.php
Ir para a documentação deste ficheiro.
1
<?php
2
/*
3
* $Id$
4
*
5
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
*
17
* This software consists of voluntary contributions made by many individuals
18
* and is licensed under the LGPL. For more information, see
19
* <http://www.doctrine-project.org>.
20
*/
21
22
namespace
Doctrine\Common\Cache
;
23
37
class
XcacheCache
extends
AbstractCache
38
{
42
public
function
getIds
()
43
{
44
$this->
_checkAuth
();
45
$keys = array();
46
47
for
($i = 0, $count = xcache_count(XC_TYPE_VAR); $i < $count; $i++) {
48
$entries = xcache_list(XC_TYPE_VAR, $i);
49
50
if
(is_array($entries[
'cache_list'
])) {
51
foreach
($entries[
'cache_list'
] as $entry) {
52
$keys[] = $entry[
'name'
];
53
}
54
}
55
}
56
57
return
$keys;
58
}
59
63
protected
function
_doFetch
(
$id
)
64
{
65
return
$this->
_doContains
(
$id
) ? unserialize(xcache_get(
$id
)) :
false
;
66
}
67
71
protected
function
_doContains
(
$id
)
72
{
73
return
xcache_isset(
$id
);
74
}
75
79
protected
function
_doSave
(
$id
, $data, $lifeTime = 0)
80
{
81
return
xcache_set(
$id
, serialize($data), (
int
) $lifeTime);
82
}
83
87
protected
function
_doDelete
(
$id
)
88
{
89
return
xcache_unset(
$id
);
90
}
91
92
99
protected
function
_checkAuth
()
100
{
101
if
(ini_get(
'xcache.admin.enable_auth'
)) {
102
throw
new \BadMethodCallException(
'To use all features of \Doctrine\Common\Cache\XcacheCache, you must set "xcache.admin.enable_auth" to "Off" in your php.ini.'
);
103
}
104
}
105
}
Doctrine\Common\Cache\AbstractCache
Definição
AbstractCache.php:32
Doctrine\Common\Cache\XcacheCache
Definição
XcacheCache.php:38
Doctrine\Common\Cache\XcacheCache\_doContains
_doContains($id)
Definição
XcacheCache.php:71
Doctrine\Common\Cache\XcacheCache\_doFetch
_doFetch($id)
Definição
XcacheCache.php:63
Doctrine\Common\Cache\XcacheCache\_doSave
_doSave($id, $data, $lifeTime=0)
Definição
XcacheCache.php:79
Doctrine\Common\Cache\XcacheCache\_doDelete
_doDelete($id)
Definição
XcacheCache.php:87
Doctrine\Common\Cache\XcacheCache\getIds
getIds()
Definição
XcacheCache.php:42
Doctrine\Common\Cache\XcacheCache\_checkAuth
_checkAuth()
Definição
XcacheCache.php:99
Doctrine\Common\Cache
Definição
AbstractCache.php:20
$id
$id
Definição
base.php:5
classes
extensions
doctrine-dbal
Doctrine
Common
Cache
XcacheCache.php
Gerado por
1.10.0