本文整理汇总了PHP中apcu_delete函数的典型用法代码示例。如果您正苦于以下问题:PHP apcu_delete函数的具体用法?PHP apcu_delete怎么用?PHP apcu_delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了apcu_delete函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doDelete
/**
* {@inheritdoc}
*/
protected function doDelete(array $ids)
{
foreach ($ids as $id) {
apcu_delete($id);
}
return true;
}
示例2: deleteKey
/**
* Delete a key from the cache pool
*
* @param $key
*
* @return bool
*/
public function deleteKey($key)
{
if (function_exists('apcu_delete')) {
return apcu_delete($key);
}
return apc_delete($key);
}
示例3: remove
public function remove($key)
{
if ($this->apcu) {
return apcu_delete((string) $key);
}
return apc_delete((string) $key);
}
示例4: cleanup
public function cleanup()
{
$regexp = self::CACHE_PREFIX . (empty($this->_config['store_prefix']) ? '' : $this->_config['store_prefix'] . ':');
$regexp = preg_quote($regexp, '/');
$to_be_deleted = new \APCuIterator("/^{$regexp}/", APC_ITER_VALUE);
return apcu_delete($to_be_deleted);
}
示例5: deleteMultiple
public function deleteMultiple(array $keys)
{
// The docs leave out the fact that apcu_delete() can take an array of keys,
// when you provide an array of keys, it provides an array of errors (if any)
// so the only successful case is no errors (empty array).
$ret = apcu_delete($keys);
return empty($ret);
}
示例6: delete
public function delete($name)
{
if ($this->hasAPCu) {
apcu_delete($name);
} else {
unset($_SESSION[$name]);
}
}
示例7: delete
/**
* Delete a value from the cache
*
* @param string $key
* @throws \Desarrolla2\Cache\Exception\ApcCacheException
*/
public function delete($key)
{
if ($this->has($key)) {
$tKey = $this->getKey($key);
if (!($this->apcu ? \apcu_delete($tKey) : \apc_delete($tKey))) {
throw new ApcCacheException('Error deleting data with the key "' . $key . '" from the APC cache.');
}
}
}
示例8: delete
public static function delete($k)
{
if (function_exists('apc_delete')) {
return apc_delete($k);
} elseif (function_exists('apcu_delete')) {
return apcu_delete($k);
}
return false;
}
示例9: remove
public function remove($id)
{
$id = $this->_processId($id);
$ret = true;
if (php_sapi_name() == 'cli') {
$ret = Kwf_Util_Apc::callClearCacheByCli(array('cacheIds' => $id));
}
return $ret && apcu_delete($id);
}
示例10: delete
/**
* {@inheritdoc}
*
* @return \Orno\Cache\Adapter\Apc
*/
public function delete($key)
{
if ($this->apcu) {
apcu_delete($key);
} else {
apc_delete($key);
}
return $this;
}
示例11: del
public function del($key)
{
if (is_array($key)) {
foreach ($key as $k) {
apcu_delete($k);
}
} else {
apcu_delete($key);
}
}
示例12: deleteArrayDataFromStorage
/**
* {@inheritdoc}
*/
protected function deleteArrayDataFromStorage(array $keys)
{
$deleted = true;
foreach ($keys as $key) {
if (apcu_delete($key) === false) {
$deleted = false;
}
}
return $deleted;
}
示例13: del
/**
* @inheritdoc
*/
public function del($key, $fields)
{
if (is_string($fields)) {
return (int) apcu_delete($this->getKeyByField($key, $fields));
}
$data = array_map(function ($field) use($key) {
return (int) apcu_delete($this->getKeyByField($key, $field));
}, $fields);
$result = array_count_values($data);
return empty($result[1]) ? 0 : $result[1];
}
示例14: clear
public function clear($prefix = '')
{
$ns = $this->getPrefix() . $prefix;
$ns = preg_quote($ns, '/');
if (class_exists('\\APCIterator')) {
$iter = new \APCIterator('user', '/^' . $ns . '/', APC_ITER_KEY);
} else {
$iter = new \APCUIterator('/^' . $ns . '/', APC_ITER_KEY);
}
return apcu_delete($iter);
}
示例15: flush
public function flush()
{
$this->_cache = array();
$iterator = class_exists('\\APCUIterator') ? new \APCUIterator() : new \APCIterator('user');
foreach ($iterator as $key => $value) {
if ($this->_prefix === '' or strpos($key, $this->_prefix) === 0) {
\apcu_delete($key);
}
}
$iterator = null;
return $this;
}