Changeset cc95700 in github
- Timestamp:
- Feb 5, 2006 10:38:51 AM (7 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- bde645f
- Parents:
- fd80c1e
- Files:
-
- 4 edited
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/main.inc (modified) (3 diffs)
-
program/include/rcube_shared.inc (modified) (1 diff)
-
program/include/session.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
config/main.inc.php.dist
r58e3602a rcc95700 22 22 // this is recommended if the IMAP server does not run on the same machine 23 23 $rcmail_config['enable_caching'] = TRUE; 24 25 // lifetime of message cache 26 // possible units: s, m, h, d, w 27 $rcmail_config['message_cache_lifetime'] = '10d'; 24 28 25 29 // automatically create a new RoundCube user when log-in the first time. -
program/include/main.inc
r58e3602a rcc95700 698 698 699 699 700 // remove all expired message cache records 701 function rcmail_message_cache_gc() 702 { 703 global $DB, $CONFIG; 704 705 // no cache lifetime configured 706 if (empty($CONFIG['message_cache_lifetime'])) 707 return; 708 709 // get target timestamp 710 $ts = get_offset_time($CONFIG['message_cache_lifetime'], -1); 711 712 $DB->query("DELETE FROM ".get_table_name('messages')." 713 WHERE created < ".$DB->fromunixtime($ts)); 714 } 715 700 716 701 717 // convert a string from one charset to another … … 710 726 711 727 // convert charset using iconv module 712 if ( 0 &&function_exists('iconv') && $from!='UTF-7' && $to!='UTF-7') {728 if (function_exists('iconv') && $from!='UTF-7' && $to!='UTF-7') { 713 729 return iconv($from, $to, $str); 714 730 } … … 1507 1523 1508 1524 1525 /****** debugging function ********/ 1526 1509 1527 function rcube_timer() 1510 1528 { -
program/include/rcube_shared.inc
r3f9edb4 rcc95700 1354 1354 1355 1355 1356 // create a unix timestamp with a specified offset from now 1357 function get_offset_time($offset_str, $factor=1) 1358 { 1359 if (preg_match('/^([0-9]+)\s*([smhdw])/i', $offset_str, $regs)) 1360 { 1361 $amount = (int)$regs[1]; 1362 $unit = strtolower($regs[2]); 1363 } 1364 else 1365 { 1366 $amount = (int)$offset_str; 1367 $unit = 's'; 1368 } 1369 1370 $ts = mktime(); 1371 switch ($unit) 1372 { 1373 case 'w': 1374 $amount *= 7; 1375 case 'd': 1376 $amount *= 24; 1377 case 'h': 1378 $amount *= 60; 1379 case 'h': 1380 $amount *= 60; 1381 case 's': 1382 $ts += $amount * $factor; 1383 } 1384 1385 return $ts; 1386 } 1387 1388 1356 1389 ?> -
program/include/session.inc
r1cded85 rcc95700 107 107 108 108 rcmail_clear_session_temp($key); 109 110 109 return TRUE; 111 110 } … … 143 142 rcmail_clear_session_temp($key); 144 143 144 // also run message cache GC 145 rcmail_message_cache_gc(); 146 145 147 return TRUE; 146 148 }
Note: See TracChangeset
for help on using the changeset viewer.
