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

Changeset 603


Ignore:
Timestamp:
Nov 6, 2006, 11:03:53 PM (14 years ago)
Author:
ebihara
Message:

function cache関連処理をwebapp/lib/util/cache.phpに移動

Location:
OpenPNE/branches/ebihara/prj_tuning_2_5/webapp/lib
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/ebihara/prj_tuning_2_5/webapp/lib/db/commu.php

    r600 r603  
    18811881{
    18821882    //function cacheの削除
    1883     pne_cache_drop('p_c_home_c_commu4c_commu_id', $c_commu_id);
     1883    cache_drop_c_commu($c_commu_id);
    18841884
    18851885    $data = array(
     
    19091909function db_commu_update_c_commu_image_filename($c_commu_id, $image_filename)
    19101910{
     1911    //function cacheの削除
     1912    cache_drop_c_commu($c_commu_id);
     1913
    19111914    $data = array('image_filename' => $image_filename);
    19121915    $where = array('c_commu_id' => intval($c_commu_id));
     
    19191922function db_commu_delete_c_commu_image_filename($c_commu_id)
    19201923{
     1924    //function cacheの削除
     1925    cache_drop_c_commu($c_commu_id);
     1926
    19211927    $data = array('image_filename' => '');
    19221928    $where = array('c_commu_id' => intval($c_commu_id));
     
    20372043{
    20382044    //function cacheの削除
    2039     pne_cache_drop('p_c_home_new_topic_comment4c_commu_id', $c_commu_topic_id, 7);
    2040     pne_cache_drop('p_c_home_new_topic_comment4c_commu_id', $c_commu_topic_id, 7, 1);
     2045    cache_drop_c_commu_topic($c_commu_topic_id);
    20412046
    20422047    // c_commu_topic_comment(画像)
     
    22022207{
    22032208    //function cacheの削除
    2204     pne_cache_drop('p_c_home_new_topic_comment4c_commu_id', $topic['c_commu_id'], 7);
    2205     pne_cache_drop('p_c_home_new_topic_comment4c_commu_id', $topic['c_commu_id'], 7, 1);
     2209    cache_drop_c_commu_topic($topic['c_commu_id']);
    22062210
    22072211    $data = array(
     
    22962300{
    22972301    //function cache削除
    2298     pne_cache_drop('p_h_home_c_commu_list4c_member_id', $c_member_id, 9);
    2299     pne_cache_drop('p_f_home_c_commu_list4c_member_id', $c_member_id, 9);
    2300     pne_cache_drop('p_c_home_c_commu_member_list4c_commu_id', $c_commu_id, 9);
     2302    cache_drop_c_commu($c_commu_id);
     2303    cache_drop_c_commu_list4c_member_id($c_member_id);
    23012304
    23022305    $data = array(
     
    23142317{
    23152318    //function cache削除
    2316     pne_cache_drop('p_h_home_c_commu_list4c_member_id', $c_member_id, 9);
    2317     pne_cache_drop('p_f_home_c_commu_list4c_member_id', $c_member_id, 9);
    2318     pne_cache_drop('p_c_home_c_commu_member_list4c_commu_id', $c_commu_id, 9);
     2319    cache_drop_c_commu($c_commu_id);
     2320    cache_drop_c_commu_list4c_member_id($c_member_id);
    23192321
    23202322    $sql = 'DELETE FROM c_commu_review' .
  • OpenPNE/branches/ebihara/prj_tuning_2_5/webapp/lib/db/etc.php

    r601 r603  
    261261{
    262262    //function cache削除
    263     pne_cache_drop('p_f_home_c_friend_list4c_member_id', $c_member_id, 9);
    264     pne_cache_drop('p_h_home_c_diary_friend_list4c_member_id', $c_member_id, 5);
    265 
    266     include_once 'Calendar/Week.php';
    267 
    268     $Week = new Calendar_Week(date('Y'), date('m'), date('d'), 0);
    269     $Week->build();
    270     while ($Day = $Week->fetch()) {
    271         $m = $Day->thisMonth();
    272         $d = $Day->thisDay();
    273         pne_cache_drop('p_h_home_birth4c_member_id', $m, $d, $c_member_id);
    274     }
     263    cache_drop_c_member($c_member_id);
    275264
    276265    //// --- 双方向パターン
  • OpenPNE/branches/ebihara/prj_tuning_2_5/webapp/lib/db/friend.php

    r601 r603  
    595595{
    596596    //function cache削除
    597     pne_cache_drop('p_f_home_c_friend_list4c_member_id', $c_member_id_from, 9);
    598     pne_cache_drop('p_h_home_c_diary_friend_list4c_member_id', $c_member_id_from, 5);
    599     pne_cache_drop('p_f_home_c_friend_list4c_member_id', $c_member_id_to, 9);
    600 
    601     include_once 'Calendar/Week.php';
    602 
    603     $Week = new Calendar_Week(date('Y'), date('m'), date('d'), 0);
    604     $Week->build();
    605     while ($Day = $Week->fetch()) {
    606         $m = $Day->thisMonth();
    607         $d = $Day->thisDay();
    608         pne_cache_drop('p_h_home_birth4c_member_id', $m, $d, $c_member_id_from);
    609     }
     597    cache_drop_c_member($c_member_id_from);
     598    cache_drop_c_member($c_member_id_to);
    610599
    611600    if (($c_member_id_from < 1) || ($c_member_id_to < 1))
     
    659648{
    660649    //function cache削除
    661     pne_cache_drop('p_f_home_c_friend_list4c_member_id', $c_member_id_from, 9);
    662     pne_cache_drop('p_h_home_c_diary_friend_list4c_member_id', $c_member_id_from, 5);
    663     pne_cache_drop('p_f_home_c_friend_list4c_member_id', $c_member_id_to, 9);
    664 
    665     include_once 'Calendar/Week.php';
    666 
    667     $Week = new Calendar_Week(date('Y'), date('m'), date('d'), 0);
    668     $Week->build();
    669     while ($Day = $Week->fetch()) {
    670         $m = $Day->thisMonth();
    671         $d = $Day->thisDay();
    672         pne_cache_drop('p_h_home_birth4c_member_id', $m, $d, $c_member_id_from);
    673     }
     650    cache_drop_c_member($c_member_id_from);
     651    cache_drop_c_member($c_member_id_to);
    674652
    675653    $sql = 'DELETE FROM c_friend' .
  • OpenPNE/branches/ebihara/prj_tuning_2_5/webapp/lib/util.inc.php

    r102 r603  
    1313require_once dirname(__FILE__) . '/util/message.php';
    1414require_once dirname(__FILE__) . '/util/emoji.php';
     15require_once dirname(__FILE__) . '/util/cache.php';
    1516
    1617?>
  • OpenPNE/branches/ebihara/prj_tuning_2_5/webapp/lib/util/util.php

    r584 r603  
    397397//---
    398398
    399 function &get_cache_lite_function()
    400 {
    401     static $instance;
    402     if (empty($instance)) {
    403         include_once 'Cache/Lite/Function.php';
    404         $options = array(
    405             'cacheDir' => OPENPNE_VAR_DIR . '/function_cache/',
    406             'hashedDirectoryLevel' => 2,
    407             'hashedDirectoryUmask' => 0777,
    408         );
    409         $instance = new Cache_Lite_Function($options);
    410     }
    411     return $instance;
    412 }
    413 
    414 /**
    415  * call function cache
    416  */
    417 function pne_cache_call()
    418 {
    419     $arg_list = func_get_args();
    420     $lifetime = array_shift($arg_list);
    421 
    422     if (OPENPNE_USE_FUNCTION_CACHE) {
    423         $cache =& get_cache_lite_function();
    424         $cache->setOption('lifetime', intval($lifetime));
    425         return call_user_func_array(array(&$cache, 'call'), $arg_list);
    426     } else {
    427         $function = array_shift($arg_list);
    428         return call_user_func_array($function, $arg_list);
    429     }
    430 }
    431 
    432 /**
    433  * drop function cache
    434  */
    435 function pne_cache_drop()
    436 {
    437     $arg_list = func_get_args();
    438 
    439     if (OPENPNE_USE_FUNCITON_CACHE) {
    440         $cache =& get_cache_lite_function();
    441         return call_user_func_array(array(&$cache, 'drop'), $arg_list);
    442     } else {
    443         return true;
    444     }
    445 }
    446 
    447 //---
    448 
    449399/**
    450400 * Check c_diary.public_flag
Note: See TracChangeset for help on using the changeset viewer.