ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 1529


Ignore:
Timestamp:
Jan 9, 2007, 6:42:38 PM (14 years ago)
Author:
ebihara
Message:

新着メッセージ数確認部分にfunction cacheを適用

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/ebihara/prj_tuning/webapp/lib/db/message.php

    r619 r1529  
    3232function db_message_count_c_message_not_is_read4c_member_to_id($c_member_id_to)
    3333{
     34    static $is_recurred = false;  //再帰処理中かどうかの判定フラグ
     35
     36    if (!$is_recurred) {  //function cacheのために再帰処理を行う
     37        $is_recurred = true;
     38        $funcargs = func_get_args();
     39        return pne_cache_recursive_call(OPENPNE_FUNCTION_CACHE_LIFETIME_FAST, __FUNCTION__, $funcargs);
     40    }
     41
     42    $is_recurred = false;
     43
    3444    $sql = 'SELECT COUNT(*) FROM c_message WHERE c_member_id_to = ?' .
    3545            ' AND is_read = 0 AND is_send = 1';
     
    505515        'c_member_id_to' => intval($c_member_id),
    506516    );
     517    pne_cache_drop('db_message_count_c_message_not_is_read4c_member_to_id', $c_member_id);
    507518    return db_update('c_message', $data, $where);
    508519}
Note: See TracChangeset for help on using the changeset viewer.