当前位置: 首页>>代码示例>>PHP>>正文


PHP TD::get_cache方法代码示例

本文整理汇总了PHP中TD::get_cache方法的典型用法代码示例。如果您正苦于以下问题:PHP TD::get_cache方法的具体用法?PHP TD::get_cache怎么用?PHP TD::get_cache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TD的用法示例。


在下文中一共展示了TD::get_cache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
     }
 }
开发者ID:sany217,项目名称:WeiXin,代码行数:23,代码来源:weixinqy.base.funcs.php

示例2: mobile_push_notification

function mobile_push_notification($uid_sent, $content, $module, $options = NULL)
{
    $org_content = $content;
    $PARA_ARRAY = get_sys_para("MOBILE_PUSH_OPTION,PCONLINE_MOBILE_PUSH", FALSE);
    while (list($PARA_NAME, $PARA_VALUE) = each(&$PARA_ARRAY)) {
        ${$PARA_NAME} = $PARA_VALUE;
    }
    if ($MOBILE_PUSH_OPTION == "1") {
        if ($uid_sent == "") {
            return;
        }
        if (substr($uid_sent, -1) != ",") {
            $uid_sent .= ",";
        }
        $module = strtolower($module);
        $mp_to_uids = td_trim($uid_sent);
        $a_uid_sent = $a_unpush_uid = array();
        $a_uid_sent = explode(",", $mp_to_uids);
        if ($PCONLINE_MOBILE_PUSH == "0") {
            $query = "select DISTINCT(UID) from user_online where UID in(" . $mp_to_uids . ") and CLIENT!=5 and CLIENT!=6";
            $cursor = exequery(TD::conn(), $query);
            while ($ROW = mysql_fetch_array($cursor)) {
                $a_unpush_uid[] = $ROW['UID'];
            }
            foreach ($a_uid_sent as $k => $v) {
                if (!($PCONLINE_MOBILE_PUSH == "0") && !is_array($a_unpush_uid) && !in_array($v, $a_unpush_uid)) {
                    unset($a_uid_sent[$k]);
                }
            }
            $a_uid_sent = array_filter($a_uid_sent);
            $uid_sent = implode(",", $a_uid_sent);
            $uid_sent .= ",";
        }
        if ($module == "message") {
            include_once "task/message_push/funcs.php";
            $C_MOBILE_DEVICES = TD::get_cache("C_MOBILE_DEVICES");
            if ($C_MOBILE_DEVICES === FALSE) {
                rebuildmobilecache();
                $C_MOBILE_DEVICES = TD::get_cache("C_MOBILE_DEVICES");
            }
            if ($C_MOBILE_DEVICES && 0 < count($C_MOBILE_DEVICES)) {
                $M_STA = $M_ENT = array();
                foreach ($a_uid_sent as $k => $v) {
                    if ($C_MOBILE_DEVICES[$v]) {
                        if ($C_MOBILE_DEVICES[$v]['client_ver'] == 1) {
                            $M_STA[$v][] = array("content" => $content, "module" => "message");
                        } else {
                            if ($C_MOBILE_DEVICES[$v]['client_ver'] == 2) {
                                $M_ENT[$v][] = array("content" => $content, "module" => "message");
                            }
                        }
                    }
                }
            }
            tdmobilepush(array("sta" => $M_STA, "ent" => $M_ENT));
        }
        $content = $org_content = strip_tags($content);
        if (strtolower(MYOA_CHARSET) != "utf-8") {
            $content = td_iconv($content, MYOA_CHARSET, "UTF-8");
        }
        imtask("C^m^n^" . $uid_sent . "^" . $module . "^" . $content);
        if (!$MYOA_WEIXINQY_PUSH_ACTIVE) {
            $useble_module = array("email", "news", "notify");
            if (!in_array($module, $useble_module)) {
                $uid_sents = td_trim($uid_sent);
                $query = "SELECT USER_ID FROM USER WHERE UID IN (" . $uid_sents . ")";
                $cursor = exequery(TD::conn(), $query);
                while ($ROW = mysql_fetch_array($cursor)) {
                    $user_id_arr[] = $ROW['USER_ID'];
                }
                wxqy_sms(array("user" => $user_id_arr, "module" => $module, "content" => $org_content));
            }
        }
    }
}
开发者ID:sany217,项目名称:WeiXin,代码行数:75,代码来源:itask.php

示例3: htmlspecialchars

        exit;
    }
    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'];
开发者ID:sany217,项目名称:WeiXin,代码行数:31,代码来源:setting.php

示例4: intval

<?php

include "../header_wx.php";
include "inc/utility_file.php";
$NOTIFY_ID = intval($_GET['NOTIFY_ID']);
$query = "SELECT * from NOTIFY where NOTIFY_ID='" . $NOTIFY_ID . "' and PUBLISH='1'";
$cursor = exequery(TD::conn(), $query);
if ($ROW = mysql_fetch_array($cursor)) {
    $FROM_DEPT = $ROW['FROM_DEPT'];
    $DEPARTMENT_ARRAY = TD::get_cache("SYS_DEPARTMENT");
    $FROM_DEPT_NAME = $DEPARTMENT_ARRAY[$FROM_DEPT]['DEPT_NAME'];
    $FROM_ID = $ROW['FROM_ID'];
    $SUBJECT_COLOR = $ROW['SUBJECT_COLOR'];
    $SUBJECT = $ROW['SUBJECT'];
    $ORG_SUBJECT = $SUBJECT;
    $FORMAT = $ROW['FORMAT'];
    $COMPRESS_CONTENT = @gzuncompress($ROW['COMPRESS_CONTENT']);
    if ($COMPRESS_CONTENT != "" && $FORMAT != "2") {
        $CONTENT = $COMPRESS_CONTENT;
    } else {
        $CONTENT = $ROW['CONTENT'];
    }
    $ATTACHMENT_ID = $ROW['ATTACHMENT_ID'];
    $ATTACHMENT_NAME = $ROW['ATTACHMENT_NAME'];
    $FORMAT = $ROW['FORMAT'];
    $READERS = $ROW['READERS'];
    $SUBJECT = htmlspecialchars($SUBJECT);
    $TYPE_ID = $ROW['TYPE_ID'];
    $TYPE_NAME = get_code_name($TYPE_ID, "NOTIFY");
    $DOWNLOAD = $ROW['DOWNLOAD'];
    $SUBJECT = "<font color='" . $SUBJECT_COLOR . "'>" . $SUBJECT . "</font>";
开发者ID:sany217,项目名称:WeiXin,代码行数:31,代码来源:wxread.php


注:本文中的TD::get_cache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。