本文整理汇总了PHP中CacheUtil::update方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheUtil::update方法的具体用法?PHP CacheUtil::update怎么用?PHP CacheUtil::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheUtil
的用法示例。
在下文中一共展示了CacheUtil::update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionUpdate
public function actionUpdate()
{
if (EnvUtil::submitCheck("formhash")) {
$fieldArr = array("reporttypemanage" => "", "stampenable" => 0, "stampdetails" => "", "pointsystem" => 5, "autoreview" => 0, "autoreviewstamp" => 1);
foreach ($_POST as $key => $value) {
if (in_array($key, array_keys($fieldArr))) {
$fieldArr[$key] = $value;
}
}
$stampStr = "";
if (!empty($fieldArr["stampdetails"])) {
foreach ($fieldArr["stampdetails"] as $score => $stampId) {
$stampId = empty($stampId) ? 0 : $stampId;
$stampStr .= $stampId . ":" . $score . ",";
}
}
$fieldArr["stampdetails"] = rtrim($stampStr, ",");
$apprise = EnvUtil::getRequest("apprise");
if (empty($_POST["stampdetails"][$apprise])) {
$fieldArr["autoreview"] = 0;
} else {
$fieldArr["autoreviewstamp"] = $_POST["stampdetails"][$apprise];
}
Setting::model()->modify("reportconfig", array("svalue" => serialize($fieldArr)));
CacheUtil::update("setting");
$this->success(Ibos::lang("Update succeed", "message"), $this->createUrl("dashboard/index"));
}
}
示例2: actionSetup
public function actionSetup()
{
if (EnvUtil::submitCheck("formhash")) {
$_POST["wbpostfrequency"] = 5 < intval($_POST["wbpostfrequency"]) ? $_POST["wbpostfrequency"] : 5;
$_POST["wbnums"] = 140 <= intval($_POST["wbnums"]) ? $_POST["wbnums"] : 140;
$wbwatermark = isset($_POST["wbwatermark"]) ? 1 : 0;
$wbwcenabled = isset($_POST["wbwcenabled"]) ? 1 : 0;
$postType = array("image" => 0, "topic" => 0, "praise" => 0);
if (isset($_POST["wbposttype"])) {
foreach ($postType as $key => &$val) {
if (isset($_POST["wbposttype"][$key])) {
$val = 1;
}
}
}
if (isset($_POST["wbmovements"])) {
} else {
$_POST["wbmovements"] = array();
}
$data = array("wbnums" => $_POST["wbnums"], "wbpostfrequency" => $_POST["wbpostfrequency"], "wbposttype" => $postType, "wbwatermark" => $wbwatermark, "wbwcenabled" => $wbwcenabled, "wbmovement" => $_POST["wbmovements"]);
foreach ($data as $key => $value) {
Setting::model()->updateSettingValueByKey($key, $value);
}
CacheUtil::update("setting");
$this->success(Ibos::lang("Operation succeed", "message"));
} else {
$data = array("config" => WbCommonUtil::getSetting(), "movementModule" => WbCommonUtil::getMovementModules());
$this->render("setup", $data);
}
}
示例3: actionParam
public function actionParam()
{
if (EnvUtil::submitCheck("formhash")) {
$data = array("sealfrom" => $_POST["seal_from"]);
$workRemindBefore = intval($_POST["work_remind_before"]);
$unitBefore = $_POST["unit_before"];
if (!empty($workRemindBefore)) {
$workRemindBefore .= $unitBefore;
$data["wfremindbefore"] = $workRemindBefore;
}
$workRemindAfter = $_POST["work_remind_after"];
$unitAfter = $_POST["unit_after"];
if (!empty($workRemindAfter)) {
$workRemindAfter .= $unitAfter;
$data["wfremindafter"] = $workRemindAfter;
}
foreach ($data as $key => $value) {
Setting::model()->updateSettingValueByKey($key, $value);
}
CacheUtil::update("setting");
$this->success(Ibos::lang("Operation succeed", "message"));
} else {
$keys = "wfremindbefore,wfremindafter,sealfrom";
$values = Setting::model()->fetchSettingValueByKeys($keys);
$param = array();
foreach ($values as $key => $value) {
if ($key == "wfremindbefore" || $key == "wfremindafter") {
$param[$key . "desc"] = substr($value, 0, -1);
$param[$key . "unit"] = substr($value, -1, 1);
}
$param[$key] = $value;
}
$this->render("param", array("param" => $param));
}
}
示例4: actionIndex
public function actionIndex()
{
$unit = Setting::model()->fetchSettingValueByKey("unit");
$formSubmit = EnvUtil::submitCheck("unitSubmit");
if ($formSubmit) {
$postData = array();
if (!empty($_FILES["logo"]["name"])) {
!empty($unit["logourl"]) && FileUtil::deleteFile($unit["logourl"]);
$postData["logourl"] = $this->imgUpload("logo");
} elseif (!empty($_POST["logourl"])) {
$postData["logourl"] = $_POST["logourl"];
} else {
$postData["logourl"] = "";
}
$keys = array("phone", "fullname", "shortname", "fax", "zipcode", "address", "adminemail", "systemurl");
foreach ($keys as $key) {
if (isset($_POST[$key])) {
$postData[$key] = StringUtil::filterCleanHtml($_POST[$key]);
} else {
$postData[$key] = "";
}
}
Setting::model()->updateSettingValueByKey("unit", $postData);
CacheUtil::update(array("setting"));
$this->success(Ibos::lang("Save succeed", "message"));
} else {
$license = Setting::model()->fetchSettingValueByKey("license");
$data = array("unit" => unserialize($unit), "license" => $license);
$this->render("index", $data);
}
}
示例5: actionRule
public function actionRule()
{
$formSubmit = EnvUtil::submitCheck("creditRuleSubmit");
if ($formSubmit) {
$cycles = $_POST["cycles"];
$credits = $_POST["credits"];
$rewardNums = $_POST["rewardnums"];
$rulesParam = array();
foreach ($cycles as $ruleId => $cycle) {
$rulesParam[$ruleId]["cycletype"] = $cycle;
}
foreach ($credits as $ruleId => $credit) {
foreach ($credit as $extcreditOffset => $creditValue) {
$rulesParam[$ruleId]["extcredits" . $extcreditOffset] = $creditValue;
}
}
foreach ($rewardNums as $ruleId => $rewardNum) {
$rulesParam[$ruleId]["rewardnum"] = $rewardNum;
}
foreach ($rulesParam as $ruleId => $updateValue) {
CreditRule::model()->modify($ruleId, $updateValue);
}
CacheUtil::update(array("creditRule"));
$this->success(Ibos::lang("Save succeed", "message"));
} else {
$rules = CreditRule::model()->fetchAll();
$credits = Credit::model()->fetchAll();
$data = array("rules" => $rules, "credits" => $credits);
$this->render("rule", $data);
}
}
示例6: actionSetup
public function actionSetup()
{
$formSubmit = EnvUtil::submitCheck("formhash");
if ($formSubmit) {
$data =& $_POST;
foreach (array("sendemail", "sendsms", "sendmessage") as $field) {
if (!empty($data[$field])) {
$ids = array_keys($data[$field]);
$idstr = implode(",", $ids);
Notify::model()->updateAll(array($field => 1), sprintf("FIND_IN_SET(id,'%s')", $idstr));
Notify::model()->updateAll(array($field => 0), sprintf("NOT FIND_IN_SET(id,'%s')", $idstr));
} else {
Notify::model()->updateAll(array($field => 0));
}
}
CacheUtil::update("NotifyNode");
$this->success(Ibos::lang("Save succeed", "message"));
} else {
$nodeList = Notify::model()->getNodeList();
foreach ($nodeList as &$node) {
$node["moduleName"] = Module::model()->fetchNameByModule($node["module"]);
}
$this->render("setup", array("nodeList" => $nodeList));
}
}
示例7: actionEdit
public function actionEdit()
{
if (EnvUtil::submitCheck("emailSubmit")) {
$setting = array();
foreach ($this->_fields as $field) {
if (array_key_exists($field, $_POST)) {
$setting[$field] = intval($_POST[$field]);
} else {
$setting[$field] = 0;
}
}
$roles = array();
if (isset($_POST["role"])) {
foreach ($_POST["role"] as $role) {
if (!empty($role["positionid"]) && !empty($role["size"])) {
$positionId = StringUtil::getId($role["positionid"]);
$roles[implode(",", $positionId)] = intval($role["size"]);
}
}
}
$setting["emailroleallocation"] = serialize($roles);
foreach ($setting as $key => $value) {
Setting::model()->updateSettingValueByKey($key, $value);
}
CacheUtil::update("setting");
$this->success(Ibos::lang("Update succeed", "message"), $this->createUrl("dashboard/index"));
}
}
示例8: actionEdit
public function actionEdit()
{
if (Ibos::app()->request->getIsAjaxRequest()) {
if (EnvUtil::getRequest("op") === "structure") {
$curId = EnvUtil::getRequest("curid");
$objId = EnvUtil::getRequest("objid");
$status = $this->setStructure($curId, $objId);
$this->ajaxReturn(array("IsSuccess" => $status), "json");
}
$deptId = EnvUtil::getRequest("deptid");
if ($deptId == 0) {
$keys = array("phone", "fullname", "shortname", "fax", "zipcode", "address", "adminemail");
$postData = array();
foreach ($_POST as $key => $value) {
if (in_array($key, $keys)) {
$postData[$key] = $value;
}
}
Setting::model()->updateSettingValueByKey("unit", $postData);
$editStatus = true;
CacheUtil::update(array("setting"));
} else {
$this->dealWithBranch();
$this->dealWithSpecialParams();
$data = Department::model()->create();
$editStatus = Department::model()->modify($data["deptid"], $data);
$editStatus && OrgUtil::update();
}
$this->ajaxReturn(array("IsSuccess" => !!$editStatus), "json");
}
}
示例9: actionIndex
public function actionIndex()
{
$type = EnvUtil::getRequest("type");
$allowType = array("rtx", "qq");
if (!in_array($type, $allowType)) {
$type = "rtx";
}
$diff = array_diff($allowType, array($type));
$value = Setting::model()->fetchSettingValueByKey("im");
$im = unserialize($value);
$formSubmit = EnvUtil::submitCheck("imSubmit");
if ($formSubmit) {
$type = $_POST["type"];
if ($type == "rtx") {
$keys = array("open", "server", "appport", "sdkport", "push", "sso", "reverselanding", "syncuser");
} elseif ($type == "qq") {
$keys = array("open", "id", "token", "appid", "appsecret", "push", "sso", "syncuser", "syncorg", "showunread", "refresh_token", "time", "expires_in");
}
$updateList = array();
foreach ($keys as $key) {
if (isset($_POST[$key])) {
$updateList[$key] = $_POST[$key];
} else {
$updateList[$key] = 0;
}
}
if ($updateList["open"] == "1") {
$this->checkImUnique($diff);
$correct = MessageUtil::getIsImBinding($type, $updateList);
if ($correct !== true) {
$updateList["open"] = 0;
} elseif ($type == "qq") {
$updateList["checkpass"] = 1;
}
} else {
if ($type == "qq") {
$updateList["checkpass"] = 0;
}
$correct = true;
}
$im[$type] = $updateList;
Setting::model()->updateSettingValueByKey("im", $im);
CacheUtil::update(array("setting"));
if ($correct === true) {
$this->success(Ibos::lang("Save succeed", "message"));
} else {
$updateList["open"] = 0;
if (is_array($correct)) {
$msg = isset($correct[ICIM::ERROR_INIT]) ? implode(",", $correct[ICIM::ERROR_INIT]) : Ibos::lang("Unknown error", "error");
} else {
$msg = Ibos::lang("Unknown error", "error");
}
$this->error(Ibos::lang("Binding error", "", array("{err}" => $msg)));
}
} else {
$data = array("type" => $type, "im" => $im[$type]);
$this->render($type, $data);
}
}
示例10: actionIndex
public function actionIndex()
{
$types = EnvUtil::getRequest("updatetype");
$data = array();
if (EnvUtil::submitCheck("formhash")) {
$type = implode(",", $types);
if (!empty($type)) {
$this->redirect($this->createUrl("update/index", array("doupdate" => 1, "updatetype" => $type)));
}
}
if (Ibos::app()->request->getIsAjaxRequest()) {
$op = EnvUtil::getRequest("op");
if (LOCAL) {
@set_time_limit(0);
}
if ($op == "data") {
CacheUtil::update();
}
if ($op == "static") {
LOCAL && Ibos::app()->assetManager->republicAll();
OrgUtil::update();
}
if ($op == "module") {
ModuleUtil::updateConfig();
}
Ibos::app()->cache->clear();
$this->ajaxReturn(array("isSuccess" => true));
}
if (EnvUtil::getRequest("doupdate") == 1) {
$type = explode(",", trim($types, ","));
$data["doUpdate"] = true;
foreach ($type as $index => $act) {
if (!empty($act)) {
if (in_array("data", $type)) {
unset($type[$index]);
$data["typedesc"] = Ibos::lang("Update") . Ibos::lang("Data cache");
$data["op"] = "data";
break;
}
if (in_array("static", $type)) {
unset($type[$index]);
$data["typedesc"] = Ibos::lang("Update") . Ibos::lang("Static cache");
$data["op"] = "static";
break;
}
if (in_array("module", $type)) {
$data["typedesc"] = Ibos::lang("Update") . Ibos::lang("Module setting");
$data["op"] = "module";
unset($type[$index]);
break;
}
}
}
$data["next"] = $this->createUrl("update/index", array("doupdate" => intval(!empty($type)), "updatetype" => implode(",", $type)));
} else {
$data["doUpdate"] = false;
}
$this->render("index", $data);
}
示例11: actionSwitchstatus
public function actionSwitchstatus()
{
if (Ibos::app()->getRequest()->getIsAjaxRequest()) {
$val = EnvUtil::getRequest("val");
$result = Setting::model()->updateSettingValueByKey("appclosed", (int) $val);
CacheUtil::update(array("setting"));
return $this->ajaxReturn(array("IsSuccess" => $result), "json");
}
}
示例12: actionEdit
public function actionEdit()
{
$votethumbenable = 0;
if (isset($_POST["votethumbenable"])) {
$votethumbenable = $_POST["votethumbenable"];
}
$width = empty($_POST["votethumbwidth"]) ? 0 : $_POST["votethumbwidth"];
$height = empty($_POST["votethumbheight"]) ? 0 : $_POST["votethumbheight"];
$votethumbewh = $width . "," . $height;
Setting::model()->modify("votethumbenable", array("svalue" => $votethumbenable));
Setting::model()->modify("votethumbwh", array("svalue" => $votethumbewh));
CacheUtil::update("setting");
$this->success(Ibos::lang("Update succeed", "message"), $this->createUrl("dashboard/index"));
}
示例13: actionStatus
public function actionStatus()
{
$moduleStatus = EnvUtil::getRequest("type");
$module = EnvUtil::getRequest("module");
if (Ibos::app()->getRequest()->getIsAjaxRequest()) {
$status = 0;
if ($moduleStatus == "disabled") {
$status = 1;
}
$changeStatus = Module::model()->modify($module, array("disabled" => $status));
Nav::model()->updateAll(array("disabled" => $status), "module = :module", array(":module" => $module));
CacheUtil::update(array("setting", "nav"));
ModuleUtil::updateConfig($module);
$this->ajaxReturn(array("IsSuccess" => $changeStatus), "json");
}
}
示例14: ipBanned
public static function ipBanned($onlineip)
{
CacheUtil::load("ipbanned");
$ipBanned = Ibos::app()->setting->get("cache/ipbanned");
if (empty($ipBanned)) {
return false;
} else {
if ($ipBanned["expiration"] < TIMESTAMP) {
CacheUtil::update("ipbanned");
CacheUtil::load("ipbanned", true);
$ipBanned = Ibos::app()->setting->get("cache/ipbanned");
}
return preg_match("/^(" . $ipBanned["regexp"] . ")\$/", $onlineip);
}
return preg_match("/^(" . $ipBanned["regexp"] . ")\$/", $onlineip);
}
示例15: actionIndex
public function actionIndex()
{
$formSubmit = EnvUtil::submitCheck("dateSetupSubmit");
if ($formSubmit) {
$data = array("dateformat" => $_POST["dateFormat"], "timeformat" => $_POST["timeFormat"], "dateconvert" => $_POST["dateConvert"], "timeoffset" => $_POST["timeOffset"]);
foreach ($data as $sKey => $sValue) {
Setting::model()->updateSettingValueByKey($sKey, $sValue);
}
CacheUtil::update(array("setting"));
$this->success(Ibos::lang("Save succeed", "message"));
} else {
$date = Setting::model()->fetchSettingValueByKeys("dateformat,dateconvert,timeformat,timeoffset");
$data = array("timeZone" => Ibos::getLangSource("dashboard.timeZone"), "date" => $date);
$this->render("index", $data);
}
}