本文整理汇总了PHP中DataManager::CacheClear方法的典型用法代码示例。如果您正苦于以下问题:PHP DataManager::CacheClear方法的具体用法?PHP DataManager::CacheClear怎么用?PHP DataManager::CacheClear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager::CacheClear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UpdateRevision
/**
* Update the revision information of a cobrand from the config.version table.
*
* @param array $cobrandid, $role
* @return boolean
*/
function UpdateRevision($cobrandid, $role)
{
$ret = false;
if ($cobrandid && $role) {
if ($this->GetRevision($cobrandid, $role, true)) {
$query = DataManager::Query("db.config.version.{$cobrandid}.{$role}:nocache", "UPDATE config.version SET revision=revision+1, updated=now() WHERE cobrandid=:cobrandid and role=:role", array(":cobrandid" => $cobrandid, ":role" => $role));
if (!empty($query) && $query->numrows > 0) {
$ret = true;
}
}
}
if ($ret) {
DataManager::CacheClear("db.config.version.{$cobrandid}.{$role}");
DataManager::CacheClear("db.config.version.ALL.{$role}");
}
return $ret;
}
示例2: controller_memcache
function controller_memcache(&$args, $output = "inline")
{
$vars["admin"] = false;
$user = User::singleton();
if ($user->isLoggedIn() && $user->HasRole("ADMIN")) {
if (!empty($args["memcacheaction"])) {
if ($args["memcacheaction"] == "delete" && !empty($args["memcachekey"])) {
DataManager::CacheClear($args["memcachekey"]);
$vars["tf_debug_memcache_status"] = "Deleted key '{$args['memcachekey']}'";
} else {
if ($args["memcacheaction"] == "flush" && !empty($args["memcachetype"])) {
$data = DataManager::singleton();
if (!empty($data->caches["memcache"][$args["memcachetype"]])) {
if ($data->caches["memcache"][$args["memcachetype"]]->flush()) {
$vars["tf_debug_memcache_status"] = "Cache flushed successfully (" . $args["memcachetype"] . ")";
} else {
$vars["tf_debug_memcache_status"] = "FAILED TO FLUSH CACHE: " . $args["memcachetype"];
}
} else {
$vars["tf_debug_memcache_status"] = "ERROR: Unknown memcache type '" . $args["memcachetype"] . "'";
}
}
}
}
$vars["admin"] = true;
}
if (!empty($data->caches["memcache"]["session"])) {
$vars["stats"]["session"] = $data->caches["memcache"]["session"]->getExtendedStats();
}
if (!empty($data->caches["memcache"]["data"])) {
$vars["stats"]["data"] = $data->caches["memcache"]["data"]->getExtendedStats();
}
if ($output == "ajax") {
$vars = array("tf_debug_tab_memcache" => $this->GetTemplate("./memcache.tpl", $vars));
}
return $this->GetComponentResponse("./memcache.tpl", $vars);
}
示例3: array
/**
* This function perform an update query on a row in the specified table.
*
* @param string $id (resource id)
* @param string $table
* @param array $values
* @param array $where_condition
* @return int (last insert id)
*/
static function &QueryUpdate($id, $table, $values, $where_condition = NULL, $bind_vars = array())
{
Profiler::StartTimer("DataManager::QueryUpdate()");
Profiler::StartTimer("DataManager::QueryUpdate({$id})", 3);
$qstart = microtime(true);
$rows_affected = NULL;
$queryid = new DatamanagerQueryID($id);
if ($source =& DataManager::PickSource($queryid)) {
$rows_affected = $source->QueryUpdate($queryid, $table, $values, $where_condition, $bind_vars);
if ($rows_affected > 0) {
DataManager::CacheClear($id);
}
}
Profiler::StopTimer("DataManager::QueryUpdate()");
Profiler::StopTimer("DataManager::QueryUpdate({$id})");
self::log("update", $id, $table, $qstart, microtime(true));
return $rows_affected;
}