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


PHP CacheManager::WriteDataUpdateTime方法代码示例

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


在下文中一共展示了CacheManager::WriteDataUpdateTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: up_5402_6000

function up_5402_6000($_prefix, $_link, $_engine)
{
    $commands[] = array(1060, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "resources` ADD `languages` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',ADD `kb_public` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',ADD `kb_bot` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',ADD `kb_ft_search` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',ADD INDEX ( `languages` , `kb_public` ) ");
    $commands[] = array(1060, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "resources` ADD `shortcut_word` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '';");
    $commands[] = array(1060, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_browsers` ADD `data_id` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' AFTER `visit_id`;");
    $commands[] = array(1054, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "data_updates` CHANGE `update_ratings` `update_feedbacks` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT '0';");
    $commands[] = array(1060, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "administration_log` ADD `trace` TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL AFTER `value`;");
    $commands[] = array(1060, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "events` ADD `exclude_mobile` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';");
    $commands[] = array(1060, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "events` ADD `exclude_countries` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '';");
    $commands[] = array(1050, "CREATE TABLE IF NOT EXISTS `" . DBManager::RealEscape($_prefix) . "user_data` (`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',`create` int(10) unsigned NOT NULL DEFAULT '0',`h_fullname` varchar(254) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',`h_email` varchar(254) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',`h_company` varchar(254) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',`h_phone` varchar(254) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',`h_customs` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,`h_text` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,PRIMARY KEY (`id`)) ENGINE=" . $_engine . " DEFAULT CHARSET=utf8 COLLATE=utf8_bin;");
    $commands[] = array(1050, "CREATE TABLE IF NOT EXISTS `" . DBManager::RealEscape($_prefix) . "feedbacks` (`id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`created` int(10) unsigned NOT NULL DEFAULT '0',`chat_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`ticket_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`resource_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`user_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`operator_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`group_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`data_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`ip_hash` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',PRIMARY KEY (`id`)) ENGINE=" . $_engine . " DEFAULT CHARSET=utf8 COLLATE=utf8_bin;");
    $commands[] = array(1050, "CREATE TABLE IF NOT EXISTS `" . DBManager::RealEscape($_prefix) . "feedback_criteria` (`fid` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`cid` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`value` varchar(512) COLLATE utf8_bin NOT NULL DEFAULT '',PRIMARY KEY (`fid`,`cid`)) ENGINE=" . $_engine . " DEFAULT CHARSET=utf8 COLLATE=utf8_bin;");
    $commands[] = array(1050, "CREATE TABLE IF NOT EXISTS `" . DBManager::RealEscape($_prefix) . "feedback_criteria_config` (`id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`type` tinyint(1) unsigned NOT NULL DEFAULT '0',`name` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`title` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT '',PRIMARY KEY (`id`)) ENGINE=" . $_engine . " DEFAULT CHARSET=utf8 COLLATE=utf8_bin;");
    $commands[] = array(1050, "CREATE TABLE IF NOT EXISTS `" . DBManager::RealEscape($_prefix) . "stats_aggs_feedbacks` (`year` smallint(5) unsigned NOT NULL DEFAULT '0',`month` tinyint(3) unsigned NOT NULL DEFAULT '0',`day` tinyint(3) unsigned NOT NULL DEFAULT '0',`operator_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`group_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`amount` int(10) unsigned NOT NULL DEFAULT '0',`ca` double unsigned NOT NULL DEFAULT '0',`cb` double unsigned NOT NULL DEFAULT '0',`cc` double unsigned NOT NULL DEFAULT '0',`cd` double unsigned NOT NULL DEFAULT '0',PRIMARY KEY (`year`,`month`,`day`,`operator_id`,`group_id`)) ENGINE=" . $_engine . " DEFAULT CHARSET=utf8 COLLATE=utf8_bin;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "resources` DROP `rank`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_chats` DROP `fullname`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_chats` DROP `email`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_chats` DROP `company`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_chats` DROP `phone`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_chats` DROP `customs`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_chats` DROP `question`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_browsers` DROP `fullname`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_browsers` DROP `email`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_browsers` DROP `company`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_browsers` DROP `phone`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_browsers` DROP `customs`;");
    $res = processCommandList($commands, $_link);
    // import ratings
    $_link->Query(true, "INSERT INTO `" . DBManager::RealEscape($_prefix) . "feedback_criteria_config` (`id`, `type`, `name`, `title`) VALUES ('d0', 0, 'Knowledge', '<!--lang_client_feedback_knowledge-->'),('d1', 0, 'Friendlyness', '<!--lang_client_feedback_friendliness-->'),('d2', 0, 'Responsivenness', '<!--lang_client_feedback_responsiveness-->'),('d3', 0, 'Overall', '<!--lang_client_feedback_overall-->'),('d4', 1, 'Comment', '<!--lang_client_feedback_comment-->');");
    $sttime = time();
    $max_fb_time = null;
    if ($result = $_link->Query(true, "SELECT * FROM `" . DB_PREFIX . "ratings` ORDER BY `time` DESC;")) {
        while ($sttime > time() - 15 && ($row = DBManager::FetchArray($result))) {
            $userData = new UserData($row["fullname"], $row["email"], $row["company"], "");
            $hash = $userData->Hash();
            $_link->Query(true, "INSERT IGNORE INTO `" . DBManager::RealEscape($_prefix) . "user_data` (`id`,`create`,`h_fullname`,`h_email`,`h_company`,`h_customs`) VALUES ('" . DBManager::RealEscape($hash) . "'," . intval(time()) . ",'" . DBManager::RealEscape($row["fullname"]) . "','" . DBManager::RealEscape($row["email"]) . "','" . DBManager::RealEscape($row["company"]) . "','');");
            $_link->Query(true, "INSERT INTO `" . DBManager::RealEscape($_prefix) . "feedbacks` (`id`, `created`, `chat_id`, `user_id`, `operator_id`, `data_id`, `ip_hash`) VALUES ('" . DBManager::RealEscape($id = getId(32)) . "', " . intval($row["time"]) . ", '" . DBManager::RealEscape($row["chat_id"]) . "', '" . DBManager::RealEscape($row["user_id"]) . "', '" . DBManager::RealEscape($row["internal_id"]) . "','" . DBManager::RealEscape($hash) . "','" . DBManager::RealEscape(md5($row["ip"])) . "');");
            $_link->Query(true, "INSERT INTO `" . DBManager::RealEscape($_prefix) . "feedback_criteria` (`fid`, `cid`, `value`) VALUES ('" . DBManager::RealEscape($id) . "', 'd0', '" . DBManager::RealEscape($row["qualification"]) . "');");
            $_link->Query(true, "INSERT INTO `" . DBManager::RealEscape($_prefix) . "feedback_criteria` (`fid`, `cid`, `value`) VALUES ('" . DBManager::RealEscape($id) . "', 'd1', '" . DBManager::RealEscape($row["politeness"]) . "');");
            if ($max_fb_time == null) {
                $max_fb_time = $row["time"];
            }
        }
    }
    if ($max_fb_time == null) {
        $max_fb_time = time();
    }
    CacheManager::WriteDataUpdateTime(DATA_UPDATE_KEY_FEEDBACKS, false, $_link, $_prefix, intval($max_fb_time) * 1000);
    CacheManager::WriteDataUpdateTime(DATA_UPDATE_KEY_FILTERS, false, $_link, $_prefix, intval(time()) * 1000);
    return $res;
}
开发者ID:sgh1986915,项目名称:laravel-eyerideonline,代码行数:51,代码来源:functions.data.db.update.inc.php

示例2: WriteDataUpdateTime

 static function WriteDataUpdateTime($_areaIndex, $_reload = false, $_connector = null, $_prefix = "", $_mtime = 0)
 {
     if (!(isset(CacheManager::$DataUpdateTimesMemory[$_areaIndex]) && CacheManager::$DataUpdateTimesMemory[$_areaIndex] == $_mtime)) {
         CacheManager::$DataUpdateTimesMemory[$_areaIndex] = $_mtime;
         $result = $_connector->Query(true, "SELECT * FROM `" . $_prefix . DATABASE_DATA_UPDATES . "`;");
         if (DBManager::GetRowCount($result) == 0 && !$_reload) {
             $_connector->Query(true, "TRUNCATE `" . $_prefix . DATABASE_DATA_UPDATES . "`;");
             $_connector->Query(true, "INSERT INTO `" . $_prefix . DATABASE_DATA_UPDATES . "` (`update_tickets`, `update_archive`, `update_feedbacks`, `update_emails`, `update_events`, `update_vouchers`, `update_filters`, `update_reports`) VALUES ('0', '0', '0', '0', '0', '0', '0', '0');");
             CacheManager::WriteDataUpdateTime($_areaIndex, true, $_connector, $_prefix, $_mtime);
         } else {
             $_connector->Query(true, "UPDATE `" . $_prefix . DATABASE_DATA_UPDATES . "` SET `" . DBManager::RealEscape($_areaIndex) . "`=" . $_mtime . ";");
             CacheManager::FlushKey(DATA_CACHE_KEY_DATA_TIMES);
         }
     }
 }
开发者ID:sgh1986915,项目名称:laravel-eyerideonline,代码行数:15,代码来源:objects.global.inc.php


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