Merge pull request #4613 from MrPetovan/task/4518-add-cache-delete
Add missing Cache::delete method
This commit is contained in:
commit
b54b0f0728
2 changed files with 25 additions and 1 deletions
|
@ -32,7 +32,7 @@ function acl_content(App $a)
|
||||||
$search = $_REQUEST['query'];
|
$search = $_REQUEST['query'];
|
||||||
}
|
}
|
||||||
|
|
||||||
logger('Searching for ' . $search . ' - type ' . $type, LOGGER_DEBUG);
|
logger("Searching for ".$search." - type ".$type." conversation ".$conv_id, LOGGER_DEBUG);
|
||||||
|
|
||||||
if ($search != '') {
|
if ($search != '') {
|
||||||
$sql_extra = "AND `name` LIKE '%%" . dbesc($search) . "%%'";
|
$sql_extra = "AND `name` LIKE '%%" . dbesc($search) . "%%'";
|
||||||
|
@ -239,6 +239,12 @@ function acl_content(App $a)
|
||||||
$items = array_merge($groups, $contacts);
|
$items = array_merge($groups, $contacts);
|
||||||
|
|
||||||
if ($conv_id) {
|
if ($conv_id) {
|
||||||
|
// In multi threaded posts the conv_id is not the parent of the whole thread
|
||||||
|
$parent_item = dba::selectFirst('item', ['parent'], ['id' => $conv_id]);
|
||||||
|
if (DBM::is_result($parent_item)) {
|
||||||
|
$conv_id = $parent_item['parent'];
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if $conv_id is set, get unknown contacts in thread
|
* if $conv_id is set, get unknown contacts in thread
|
||||||
* but first get known contacts url to filter them out
|
* but first get known contacts url to filter them out
|
||||||
|
|
|
@ -99,6 +99,24 @@ class Cache extends \Friendica\BaseObject
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Delete a value from the cache
|
||||||
|
*
|
||||||
|
* @param string $key The key to the cached data
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function delete($key)
|
||||||
|
{
|
||||||
|
$time = microtime(true);
|
||||||
|
|
||||||
|
$return = self::getDriver()->delete($key);
|
||||||
|
|
||||||
|
self::getApp()->save_timestamp($time, 'cache_write');
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Remove outdated data from the cache
|
* @brief Remove outdated data from the cache
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue