本文整理匯總了PHP中TD::set_cache方法的典型用法代碼示例。如果您正苦於以下問題:PHP TD::set_cache方法的具體用法?PHP TD::set_cache怎麽用?PHP TD::set_cache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TD
的用法示例。
在下文中一共展示了TD::set_cache方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getTokens
private function getTokens()
{
if ($this->tokens != "") {
return $this->tokens;
}
$tokens = TD::get_cache("WEIXINQY_TOKENS");
if ($tokens === FALSE) {
$request_str = http_build_query(array("corpid" => $this->corpid, "corpsecret" => $this->corpsecret));
if ($request_str != "") {
$request_url = $this->base_url . $this->weixinqy_token_url . "?" . $request_str;
}
$result = file_get_contents($request_url);
if ($result === FALSE) {
echo _("ERR: 無法連接到微信企業微信官方平台獲取Tokens");
exit;
}
$data = json_decode($result, TRUE);
$this->tokens = $data['access_token'];
TD::set_cache("WEIXINQY_TOKENS", $this->tokens, $data['expires_in']);
} else {
$this->tokens = $tokens;
}
}
示例2: htmlspecialchars
echo "failed";
exit;
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
if ($_POST['WEIXINQY_OAURL'] != "") {
$WEIXINQY_OAURL = htmlspecialchars($_POST['WEIXINQY_OAURL']);
set_sys_para(array("WEIXINQY_OAURL" => "{$WEIXINQY_OAURL}"));
}
if ($_POST['WEIXINQY_SECRET'] != "" && $_POST['WEIXINQY_CORPID'] != "") {
$WEIXINQY_CORPID = htmlspecialchars($_POST['WEIXINQY_CORPID']);
$WEIXINQY_SECRET = htmlspecialchars($_POST['WEIXINQY_SECRET']);
set_sys_para(array("WEIXINQY_SECRET" => "{$WEIXINQY_SECRET}", "WEIXINQY_CORPID" => "{$WEIXINQY_CORPID}"));
include_once "inc/utility_cache.php";
$WEIXINQY_TOKENS = TD::get_cache("WEIXINQY_TOKENS");
if ($WEIXINQY_TOKENS !== FALSE) {
TD::set_cache("WEIXINQY_TOKENS", NULL);
}
}
}
include_once "inc/conn.php";
include_once "inc/utility_update.php";
if (!field_exists("DEPARTMENT", "WEIXIN_DEPT_ID")) {
$query = "ALTER TABLE `department` ADD COLUMN `WEIXIN_DEPT_ID` int(11) NOT NULL DEFAULT 0 AFTER `DEPT_EMAIL_AUDITS_IDS`";
exequery(TD::conn(), $query, TRUE);
add_sys_para(array("WEIXINQY_SECRET" => "", "WEIXINQY_CORPID" => "", "WEIXINQY_OAURL" => "", "WEIXINQY_APP_SMS" => ""));
cache_sys_para();
}
$PARA_ARRAY = get_sys_para("WEIXINQY_CORPID,WEIXINQY_SECRET,WEIXINQY_OAURL");
$WEIXINQY_CORPID = $PARA_ARRAY['WEIXINQY_CORPID'];
$WEIXINQY_SECRET = $PARA_ARRAY['WEIXINQY_SECRET'];
$WEIXINQY_OAURL = $PARA_ARRAY['WEIXINQY_OAURL'];