Changeset 623
- Timestamp:
- 07/05/2009 10:41:16 AM (4 years ago)
- Location:
- branches/1.3
- Files:
-
- 30 modified
-
. (modified) (1 prop)
-
Decompiler.class.php (modified) (4 diffs)
-
admin/common-zh-simplified-utf-8.lang.php (modified) (2 diffs)
-
admin/common-zh-traditional-utf-8.lang.php (modified) (2 diffs)
-
admin/common.php (modified) (1 diff)
-
admin/config.php.example (modified) (2 diffs)
-
admin/header.tpl.php (modified) (1 diff)
-
admin/help-en.lang.php (modified) (1 diff)
-
admin/help-zh-simplified-utf-8.lang.php (modified) (1 diff)
-
admin/help-zh-traditional-utf-8.lang.php (modified) (1 diff)
-
admin/xcache.css (modified) (3 diffs)
-
admin/xcache.php (modified) (6 diffs)
-
admin/xcache.tpl.php (modified) (7 diffs)
-
coverager.c (modified) (3 diffs)
-
coverager/config.php.example (modified) (1 diff)
-
coverager/coverager.css (modified) (2 diffs)
-
coverager/coverager.php (modified) (3 diffs)
-
coverager/coverager.tpl.php (modified) (9 diffs)
-
mkopcode_spec.awk (modified) (1 diff)
-
phpdc.phpr (modified) (1 diff)
-
processor/hashtable.m4 (modified) (1 diff)
-
processor/processor.m4 (modified) (2 diffs)
-
processor/struct.m4 (modified) (3 diffs)
-
run-xcachetest (modified) (1 diff)
-
utils.c (modified) (3 diffs)
-
utils.h (modified) (2 diffs)
-
xcache-test.ini (modified) (1 diff)
-
xcache.c (modified) (20 diffs)
-
xcache.h (modified) (1 diff)
-
xcache.ini (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/Decompiler.class.php
r394 r623 29 29 if (is_array($src)) { 30 30 die_error('array str'); 31 $src = new Decompiler_Array($src );32 return $src->__toString( $indent);31 $src = new Decompiler_Array($src, false, $indent); 32 return $src->__toString(); 33 33 } 34 34 … … 165 165 } 166 166 167 function __toString( $indent)168 { 169 return $this->obj->__toString( $indent);167 function __toString() 168 { 169 return $this->obj->__toString(); 170 170 } 171 171 } … … 258 258 { 259 259 var $needExport = false; 260 261 function Decompiler_Array($value = array(), $needexport = false) 260 var $indent = ''; 261 262 function Decompiler_Array($value = array(), $needexport = false, $indent = '') 262 263 { 263 264 $this->value = $value; 264 265 $this->needExport = $needexport; 265 } 266 267 function __toString($indent) 266 $this->indent = $indent; 267 } 268 269 function __toString() 268 270 { 269 271 $exp = "array("; 270 $indent .=INDENT;272 $indent = $this->indent . INDENT; 271 273 $assoclen = 0; 272 274 $multiline = 0; … … 335 337 var $iskey; 336 338 337 function __toString( $indent)339 function __toString() 338 340 { 339 341 return 'foreach (' . ''; -
branches/1.3/admin/common-zh-simplified-utf-8.lang.php
r604 r623 24 24 'Compiling' 25 25 => '编译中', 26 '%' 27 => '%', 26 '% Free' 27 => '% 剩余', 28 '% Used' 29 => '% 已用', 28 30 'Hits' 29 31 => '命中', 32 'Hits 24H' 33 => '24H 分布', 34 'Hits/H' 35 => '命中/H', 36 'Hits/S' 37 => '命中/S', 30 38 'Misses' 31 39 => '错过', … … 69 77 'GC' 70 78 => 'GC', 79 'Legends:' 80 => '图例:', 81 'Used Blocks' 82 => '已用块', 83 'Free Blocks' 84 => '未用块', 85 'Total' 86 => '总共', 71 87 'Cache' 72 88 => '缓冲区', -
branches/1.3/admin/common-zh-traditional-utf-8.lang.php
r604 r623 24 24 'Compiling' 25 25 => '編譯中', 26 '%' 27 => '%', 26 '% Free' 27 => '% 剩余', 28 '% Used' 29 => '% 已用', 28 30 'Hits' 29 31 => '命中', 32 'Hits 24H' 33 => '24H 分布', 34 'Hits/H' 35 => '命中/H', 36 'Hits/S' 37 => '命中/S', 30 38 'Misses' 31 39 => '錯過', … … 69 77 'GC' 70 78 => 'GC', 79 'Legends:' 80 => '图例:', 81 'Used Blocks' 82 => '已用块', 83 'Free Blocks' 84 => '未用块', 85 'Total' 86 => '总共', 71 87 'Cache' 72 88 => '快取', -
branches/1.3/admin/common.php
r607 r623 109 109 $lang = 'en-us'; 110 110 } 111 if (!isset($usage_graph_width) && !isset($free_graph_width)) { 112 $usage_graph_width = 120; 113 } 114 $graph_width = isset($free_graph_width) ? $free_graph_width : $usage_graph_width; 111 115 112 116 ?> -
branches/1.3/admin/config.php.example
r604 r623 12 12 $show_todo_strings = false; 13 13 14 // width of graph for free or usage blocks 15 $usage_graph_width = 120; 16 // do not define both with 17 // $free_graph_width = 120; 18 14 19 // this function is detected by xcache.tpl.php, and enabled if function_exists 15 20 // this ob filter is applied for the cache list, not the whole page … … 17 22 { 18 23 $sep = DIRECTORY_SEPARATOR; 19 $o = str_replace($_SERVER['DOCUMENT_ROOT'], "{DOCROOT} $sep", $o);24 $o = str_replace($_SERVER['DOCUMENT_ROOT'], "{DOCROOT}" . (substr($d, -1) == $sep ? $sep : ""), $o); 20 25 $xcachedir = realpath(dirname(__FILE__) . "$sep..$sep"); 21 26 $o = str_replace($xcachedir . $sep, "{XCache}$sep", $o); -
branches/1.3/admin/header.tpl.php
r604 r623 1 <!DOCTYPE HTMLPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 3 <head> -
branches/1.3/admin/help-en.lang.php
r604 r623 4 4 <dt><?php echo _T('Size'); ?>: </dt><dd>Cache Size, Size of the cache (or cache chunk), in bytes</dd> 5 5 <dt><?php echo _T('Avail'); ?>: </dt><dd>Available Memory, free memory in bytes of this cache</dd> 6 <dt><?php echo _T('% '); ?>: </dt><dd>Percent, A bar shows how much memory available in percent</dd>6 <dt><?php echo _T('% Used'); ?>: </dt><dd>Percent, A bar shows how much memory available in percent, and memory blocks status</dd> 7 7 <dt><?php echo _T('Clear'); ?>: </dt><dd>Clear Button, Press the button to clean this cache</dd> 8 8 <dt><?php echo _T('Compiling'); ?>: </dt><dd>Compiling flag, "yes" if the cache is busy compiling php script</dd> 9 9 <dt><?php echo _T('Hits'); ?>: </dt><dd>Cache Hits, hit=a var/php is loaded from this cache</dd> 10 <dt><?php echo _T('Hits/H'); ?>: </dt><dd>Average Hits per Hour. Only last 24 hours is logged</dd> 11 <dt><?php echo _T('Hits 24H'); ?>: </dt><dd>Hits 24 Hours. Hits graph of last 24 hours</dd> 12 <dt><?php echo _T('Hits/S'); ?>: </dt><dd>Average Hits per Second. Only last 5 seconds is logged</dd> 10 13 <dt><?php echo _T('Misses'); ?>: </dt><dd>Cache Misses, miss=a var/php is requested but not in the cache</dd> 11 14 <dt><?php echo _T('Clogs'); ?>: </dt><dd>Compiling Clogs, clog=compiling is needed but avoided to wait(be blocked) when the cache is busy compiling already</dd> -
branches/1.3/admin/help-zh-simplified-utf-8.lang.php
r604 r623 4 4 <dt><?php echo _T('Size'); ?>: </dt><dd>共享内存区大小, 单位: 字节</dd> 5 5 <dt><?php echo _T('Avail'); ?>: </dt><dd>可用内存, 对应共享内存区的剩余内存字节数</dd> 6 <dt><?php echo _T('% '); ?>: </dt><dd>百分比, 条状显示可用内存的比例</dd>6 <dt><?php echo _T('% Used'); ?>: </dt><dd>百分比, 条状显示可用内存的比例, 以及显示分配块状态</dd> 7 7 <dt><?php echo _T('Clear'); ?>: </dt><dd>清除按钮, 点击按钮清除对应共享内存区的数据</dd> 8 8 <dt><?php echo _T('Compiling'); ?>: </dt><dd>编译标记, 当共享内存区正在编译 php 脚本时标记为 "yes"</dd> 9 9 <dt><?php echo _T('Hits'); ?>: </dt><dd>共享内存命中次数, 命中=从该共享内存载入php或者变量</dd> 10 <dt><?php echo _T('Hits/H'); ?>: </dt><dd>每小时命中次数. 只统计最后 24 小时</dd> 11 <dt><?php echo _T('Hits 24H'); ?>: </dt><dd>24 小时命中分布图. 图表现是最后 24 小时的命中次数</dd> 12 <dt><?php echo _T('Hits/S'); ?>: </dt><dd>每秒命中次数. 只统计最后 5 秒</dd> 10 13 <dt><?php echo _T('Misses'); ?>: </dt><dd>共享内存错过次数, 错过=请求的php或者变量并不在该共享内存内</dd> 11 14 <dt><?php echo _T('Clogs'); ?>: </dt><dd>编译阻塞跳过, 阻塞=当需该共享内存区负责编译时, 其他进程/现成无法访问此共享内存. 跳过=XCache 自动判断阻塞的共享内存区自动跳过阻塞等待, 直接使用非共享内存方式继续处理请求</dd> -
branches/1.3/admin/help-zh-traditional-utf-8.lang.php
r604 r623 4 4 <dt><?php echo _T('Size'); ?>: </dt><dd>共享記憶體區大小,單位:位元</dd> 5 5 <dt><?php echo _T('Avail'); ?>: </dt><dd>可用記憶體,對應共享記憶體區的剩餘記憶體位元數</dd> 6 <dt><?php echo _T('% '); ?>: </dt><dd>百分比,條狀顯示可用記憶體的比例</dd>6 <dt><?php echo _T('% Used'); ?>: </dt><dd>百分比,條狀顯示可用記憶體的比例</dd> 7 7 <dt><?php echo _T('Clear'); ?>: </dt><dd>清除按鈕,點擊按鈕清除對應共享記憶體區的資料</dd> 8 8 <dt><?php echo _T('Compiling'); ?>: </dt><dd>編譯標記,當共享記憶體區正在編譯 php 指令時標記為 "yes"</dd> -
branches/1.3/admin/xcache.css
r604 r623 1 1 input, table { font-family: sans-serif; } 2 2 input { font-size: 12px; } 3 table { border-collapse: collapse; font-size: 11px; } 3 table { border-collapse: collapse; font-size: 11px; margin: 0; margin-bottom: 10px; } 4 table caption, h2 { font-size: 16px; font-weight: bold; text-align: left; padding-top: 20px; margin-bottom: 2px; } 5 table { white-space: pre; } 4 6 table.cycles { border: 1px solid black; margin-top: 5px; margin-bottom: 5px; } 5 7 table.cycles .col1 { background-color: #f5f5f5; } … … 17 19 .button { } 18 20 span.sortarrow { color: white; text-decoration: none; } 19 .freeblocks { float: left; margin-right: 4px;}20 .freeblocks td { text-align: right; }21 21 form {margin: 0; padding: 0} 22 .percent { border: 1px solid black; width: 80%; height: 20px; } 23 .percent div { font-size: 1px; line-height: 1px; width: 100%;} 24 .percent .pavail { background: blue; } 25 .switcher, h1, h2 { text-align: center; display: block; } 22 23 .percent { height: 3px; margin-bottom: 1px; border: 1px solid gray; } 24 .percent div { float: left; height: 100%; } 25 .pvalue { background: limegreen; } 26 27 .blocksgraph { height: 16px; } 28 .blocksgraph div { float: left; height: 3px; width: 4px; border: solid gray; border-width: 0 0px 1px 0; } 29 .blocksgraph { border: 1px solid gray; border-bottom: 0px; } 30 31 .hitsgraph { height: 20px; margin: auto; } 32 .hitsgraph div { float: left; width: 2px; height: 100%; } 33 .hitsgraph div:hover { background: gray; } 34 .hitsgraph div div { float: none; width: 100%; } 35 .hitsgraph div div.barf { border: 0px solid gray; border-width: 1px 0 0 0; } 36 .hitsgraph div div.barv { border: 0px solid gray; border-width: 0 0 1px 0; } 37 .hitsgraph div div.barf.active { border-color: yellow; } 38 .hitsgraph div div.barv.active { border-color: yellow; } 39 40 .switcher, h1 { text-align: center; display: block; } 26 41 .switcher * { color: blue; } 27 42 .switcher a.active { font-weight: bold; font-size: 130%; color: black; } … … 31 46 dt { font-weight: bold; clear: both; float: left; width: 100px; text-align: right; margin: 0; } 32 47 dd { margin: 0; } 48 .blockarea { overflow: hidden; _width: 1px; } 49 div.legend { float: left; border: 1px solid gray; font: 12px/12px monospace; } 50 div.legendtitle { float: left; padding: 2px; padding-right: 10px; font: 12px/12px monospace; } -
branches/1.3/admin/xcache.php
r604 r623 73 73 74 74 return '0 s'; 75 } 76 77 function freeblock_to_graph($freeblocks, $size) 78 { 79 global $graph_width, $usage_graph_width, $free_graph_width; 80 81 // cached in static variable 82 static $graph_initial; 83 if (!isset($graph_initial)) { 84 $graph_initial = array_fill(0, $graph_width, 0); 85 } 86 $graph = $graph_initial; 87 foreach ($freeblocks as $b) { 88 $begin = $b['offset'] / $size * $graph_width; 89 $end = ($b['offset'] + $b['size']) / $size * $graph_width; 90 91 if ((int) $begin == (int) $end) { 92 $v = $end - $begin; 93 $graph[(int) $v] += $v - (int) $v; 94 } 95 else { 96 $graph[(int) $begin] += 1 - ($begin - (int) $begin); 97 $graph[(int) $end] += $end - (int) $end; 98 for ($i = (int) $begin + 1, $e = (int) $end; $i < $e; $i ++) { 99 $graph[$i] += 1; 100 } 101 } 102 } 103 $html = array(); 104 $c = 255; 105 foreach ($graph as $k => $v) { 106 if (!isset($free_graph_width)) { 107 $v = 1 - $v; 108 } 109 $v = (int) ($v * $c); 110 $r = $g = $c - $v; 111 $b = $c; 112 $html[] = '<div style="background: rgb(' . "$r,$g,$b" . ')"></div>'; 113 } 114 return implode('', $html); 115 } 116 117 function calc_total(&$total, $data) 118 { 119 foreach ($data as $k => $v) { 120 switch ($k) { 121 case 'type': 122 case 'cache_name': 123 case 'cacheid': 124 case 'free_blocks': 125 continue 2; 126 } 127 if (!isset($total[$k])) { 128 $total[$k] = $v; 129 } 130 else { 131 switch ($k) { 132 case 'his_by_hour': 133 case 'his_by_second': 134 foreach ($data[$k] as $kk => $vv) { 135 $total[$k][$kk] += $vv; 136 } 137 break; 138 139 default: 140 $total[$k] += $v; 141 } 142 } 143 } 144 } 145 146 function array_avg($a) 147 { 148 if (count($a) == 0) { 149 return ''; 150 } 151 return array_sum($a) / count($a); 152 } 153 154 function bar_hits_percent($v, $percent, $active) 155 { 156 $r = 220 + (int) ($percent * 25); 157 $g = $b = 220 - (int) ($percent * 220); 158 $percent = (int) ($percent * 100); 159 $a = $active ? ' active' : ''; 160 return '<div title="' . $v . '">' 161 . '<div class="barf' . $a . '" style="height: ' . (100 - $percent) . '%"></div>' 162 . '<div class="barv' . $a . '" style="background: rgb(' . "$r,$g,$b" . '); height: ' . $percent . '%"></div>' 163 . '</div>'; 164 } 165 166 function hits_to_graph($hits) 167 { 168 $max = 0; 169 foreach ($hits as $v) { 170 if ($max < $v) { 171 $max = $v; 172 } 173 } 174 if (!$max) { 175 return ''; 176 } 177 $t = (time() / (60 * 60)) % 24; 178 $html = array(); 179 foreach ($hits as $i => $v) { 180 $html[] = bar_hits_percent($v, $v / $max, $i == $t); 181 } 182 return implode('', $html); 75 183 } 76 184 … … 130 238 $cacheid = (int) (isset($_POST['cacheid']) ? $_POST['cacheid'] : 0); 131 239 if (isset($_POST['clearcache'])) { 132 xcache_clear_cache($type, $cacheid); 240 $count = xcache_count($type); 241 if ($cacheid == $count) { 242 for ($cacheid = 0; $cacheid < $count; $cacheid ++) { 243 xcache_clear_cache($type, $cacheid); 244 } 245 } 246 else { 247 xcache_clear_cache($type, $cacheid); 248 } 133 249 } 134 250 } … … 138 254 // {{{ load info/list 139 255 $cacheinfos = array(); 256 $total = array(); 140 257 for ($i = 0; $i < $pcnt; $i ++) { 141 258 $data = xcache_info(XC_TYPE_PHP, $i); … … 147 264 $data['cacheid'] = $i; 148 265 $cacheinfos[] = $data; 149 } 266 if ($pcnt >= 2) { 267 calc_total($total, $data); 268 } 269 } 270 271 if ($pcnt >= 2) { 272 $total['type'] = XC_TYPE_PHP; 273 $total['cache_name'] = _T('Total'); 274 $total['cacheid'] = $pcnt; 275 $total['gc'] = null; 276 $total['istotal'] = true; 277 $cacheinfos[] = $total; 278 } 279 280 $total = array(); 150 281 for ($i = 0; $i < $vcnt; $i ++) { 151 282 $data = xcache_info(XC_TYPE_VAR, $i); … … 157 288 $data['cacheid'] = $i; 158 289 $cacheinfos[] = $data; 290 if ($pcnt >= 2) { 291 calc_total($total, $data); 292 } 293 } 294 295 if ($vcnt >= 2) { 296 $total['type'] = XC_TYPE_VAR; 297 $total['cache_name'] = _T('Total'); 298 $total['cacheid'] = $vcnt; 299 $total['gc'] = null; 300 $total['istotal'] = true; 301 $cacheinfos[] = $total; 159 302 } 160 303 // }}} … … 171 314 } 172 315 foreach ($cacheinfos as $i => $c) { 316 if (!empty($c['istotal'])) { 317 continue; 318 } 173 319 if ($c['type'] == $type && isset($c['cache_list'])) { 174 320 foreach ($c['cache_list'] as $e) { -
branches/1.3/admin/xcache.tpl.php
r604 r623 1 1 <?php include("header.tpl.php"); ?> 2 <a href="help.php" target="_blank" id="help"><?php echo _T("Help") ?> »</a> 3 <span class="switcher"><?php echo switcher("type", $types); ?></span> 2 <div id="help"> 3 <a href="help.php"><?php echo _T("Help") ?> »</a> 4 </div> 5 <div class="switcher"><?php echo switcher("type", $types); ?></div> 4 6 <?php 5 7 $a = new Cycle('class="col1"', 'class="col2"'); 6 8 $b = new Cycle('class="col1"', 'class="col2"'); 7 9 ?> 8 <?php echo _T('Caches'); ?>:9 10 <table cellspacing="0" cellpadding="4" class="cycles"> 10 <col /> 11 <col align="right" /> 12 <col align="right" /> 13 <col align="right" /> 14 <col /> 15 <col /> 16 <col align="right" /> 11 <caption><?php echo _T('Caches'); ?></caption> 12 <col /> 13 <col align="right" /> 14 <col align="right" /> 15 <col align="right" /> 16 <col /> 17 <col /> 18 <col align="right" /> 19 <col align="right" /> 20 <col align="right" /> 21 <col /> 17 22 <col align="right" /> 18 23 <col align="right" /> … … 28 33 <th><?php echo _T('Size'); ?></th> 29 34 <th><?php echo _T('Avail'); ?></th> 30 <th><?php echo _T( '%'); ?></th>35 <th><?php echo _T(isset($free_graph_width) ? '% Free' : '% Used'); ?></th> 31 36 <th><?php echo _T('Clear'); ?></th> 32 37 <th><?php echo _T('Compiling'); ?></th> 33 38 <th><?php echo _T('Hits'); ?></th> 39 <th><?php echo _T('Hits/H'); ?></th> 40 <th><?php echo _T('Hits 24H'); ?></th> 41 <th><?php echo _T('Hits/S'); ?></th> 34 42 <th><?php echo _T('Misses'); ?></th> 35 43 <th><?php echo _T('Clogs'); ?></th> … … 48 56 echo " 49 57 <tr ", $a->next(), ">"; 50 $pavail = (int) ($ci['avail'] / $ci['size'] * 100); 51 $pused = 100 - $pavail; 58 $pvalue = (int) ($ci['avail'] / $ci['size'] * 100); 59 $pempty = 100 - $pvalue; 60 if (!isset($free_graph_width)) { 61 // swap 62 $tmp = $pvalue; 63 $pvalue = $pempty; 64 $pempty = $tmp; 65 } 66 67 $w = $graph_width; 68 if (empty($ci['istotal'])) { 69 $graph = freeblock_to_graph($ci['free_blocks'], $ci['size']); 70 $blocksgraph = "<div class=\"blocksgraph\" style=\"width: {$w}px\">{$graph}</div>"; 71 } 72 else { 73 $blocksgraph = ''; 74 } 52 75 53 76 $ci_slots = size($ci['slots']); … … 55 78 $ci_avail = size($ci['avail']); 56 79 $ci = number_formats($ci, $numkeys); 57 $ci['compiling'] = $ci['type'] == $type_php ? ($ci['compiling'] ? 'yes' : 'no') : '-'; 58 $ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no'; 80 81 $hits_avg_h = number_format(array_avg($ci['hits_by_hour']), 2); 82 $hits_avg_s = number_format(array_avg($ci['hits_by_second']), 2); 83 $hits_graph_h = hits_to_graph($ci['hits_by_hour']); 84 $hits_graph_h_w = count($ci['hits_by_hour']) * 2; 85 86 if (!empty($ci['istotal'])) { 87 $ci['compiling'] = '-'; 88 $ci['can_readonly'] = '-'; 89 } 90 else { 91 $ci['compiling'] = $ci['type'] == $type_php ? ($ci['compiling'] ? 'yes' : 'no') : '-'; 92 $ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no'; 93 } 59 94 echo <<<EOS 60 95 <th>{$ci['cache_name']}</th> … … 62 97 <td title="{$ci['size']}">{$ci_size}</td> 63 98 <td title="{$ci['avail']}">{$ci_avail}</td> 64 <td title="{$pavail} %"><div class="percent"><div style="height: {$pused}%" class="pused"> </div><div style="height: {$pavail}%" class="pavail"> </div></div></td> 65 <td> 66 <form method="post"> 67 <div> 68 <input type="hidden" name="type" value="{$ci['type']}"> 69 <input type="hidden" name="cacheid" value="{$ci['cacheid']}"> 70 <input type="submit" name="clearcache" value="{$l_clear}" class="submit" onclick="return confirm('{$l_clear_confirm}');" /> 71 </div> 72 </form> 73 </td> 99 <td title="{$pvalue} %" 100 ><div class="percent" style="width: {$w}px" 101 ><div style="width: {$pvalue}%" class="pvalue"></div 102 ><div style="width: {$pempty}%" class="pempty"></div 103 ></div 104 >{$blocksgraph}</td> 105 <td 106 ><form method="post" action="" 107 ><div 108 ><input type="hidden" name="type" value="{$ci['type']}" 109 /><input type="hidden" name="cacheid" value="{$ci['cacheid']}" 110 /><input type="submit" name="clearcache" value="{$l_clear}" class="submit" onclick="return confirm('{$l_clear_confirm}');" 111 /></div 112 ></form 113 ></td> 74 114 <td>{$ci['compiling']}</td> 75 115 <td>{$ci['hits']}</td> 116 <td>{$hits_avg_h}</td> 117 <td><div class="hitsgraph" style="width: {$hits_graph_h_w}px">{$hits_graph_h}</div></td> 118 <td>{$hits_avg_s}</td> 76 119 <td>{$ci['misses']}</td> 77 120 <td>{$ci['clogs']}</td> … … 89 132 <?php } ?> 90 133 </table> 91 <div> 92 <?php echo _T('Free Blocks'); ?>: 134 <div class="blockarea legends"> 135 <div class="legendtitle"><?php echo _T('Legends:'); ?></div> 136 <div class="legend pvalue"> </div> 137 <div class="legendtitle"><?php echo _T(isset($free_graph_width) ? '% Free' : '% Used'); ?></div> 138 <div class="legend" style="background: rgb(0,0,255)"> </div> 139 <div class="legendtitle"><?php echo _T(isset($free_graph_width) ? 'Free Blocks' : 'Used Blocks'); ?></div> 140 <div class="legend" style="background: rgb(255,0,0)"> </div> 141 <div class="legendtitle"><?php echo _T('Hits'); ?></div> 93 142 </div> 94 <?php95 foreach ($cacheinfos as $i => $ci) {96 $b->reset();97 ?>98 <table cellspacing="0" cellpadding="4" class="cycles freeblocks">99 <tr>100 <th><?php echo $ci['cache_name']; ?> <?php echo _T("size"); ?><br><?php echo _T("offset"); ?></th>101 <?php102 foreach ($ci['free_blocks'] as $block) {103 $size = size($block['size']);104 $offset = size($block['offset']);105 106 $c = $b->next();107 echo "108 <td $c><nobr>$size<br>$offset</nobr></td>";109 }110 ?>111 112 </tr>113 </table>114 <?php115 }116 ?>117 <div style="clear: both"> </div>118 143 <?php 119 144 … … 125 150 foreach (array('Cached' => $cachelist['cache_list'], 'Deleted' => $cachelist['deleted_list']) as $listname => $entries) { 126 151 $a->reset(); 127 echo "128 <caption>", _T("{$cachelist['type_name']} $listname"), "</caption>";129 152 ?> 130 153 131 154 <form action="" method="post"> 132 <table cellspacing="0" cellpadding="4" class="cycles entrys" width="100%"> 155 <table cellspacing="0" cellpadding="4" class="cycles entries" width="100%"> 156 <caption><?php echo _T("{$cachelist['type_name']} $listname"); ?></caption> 133 157 <col /> 134 158 <col /> -
branches/1.3/coverager.c
r617 r623 470 470 471 471 if (cfg_get_string("xcache.coveragedump_directory", &xc_coveragedump_dir) == SUCCESS && xc_coveragedump_dir) { 472 xc_coveragedump_dir = pestrdup(xc_coveragedump_dir, 1); 472 473 int len = strlen(xc_coveragedump_dir); 473 474 if (len) { … … 477 478 } 478 479 if (!strlen(xc_coveragedump_dir)) { 480 pefree(xc_coveragedump_dir, 1); 479 481 xc_coveragedump_dir = NULL; 480 482 } … … 490 492 } 491 493 if (xc_coveragedump_dir) { 494 pefree(xc_coveragedump_dir, 1); 492 495 xc_coveragedump_dir = NULL; 493 496 } -
branches/1.3/coverager/config.php.example
r604 r623 22 22 { 23 23 $sep = DIRECTORY_SEPARATOR; 24 $o = str_replace($_SERVER['DOCUMENT_ROOT'], "{DOCROOT} $sep", $o);24 $o = str_replace($_SERVER['DOCUMENT_ROOT'], "{DOCROOT}" . (substr($d, -1) == $sep ? $sep : ""), $o); 25 25 $xcachedir = realpath(dirname(__FILE__) . "$sep..$sep"); 26 26 $o = str_replace($xcachedir . $sep, "{XCache}$sep", $o); -
branches/1.3/coverager/coverager.css
r615 r623 3 3 th { font-size: 12px; } 4 4 table { border-collapse: collapse; } 5 table.center { margin-left: auto; margin-right: auto; } 6 table\-center { text-align: center; } 5 7 table.cycles { border: 1px solid black; margin-top: 5px; margin-bottom: 5px; } 6 8 table.cycles .col1 { background-color: #f5f5f5; } … … 55 57 .lineCov { background-color: #F0F0F0; } 56 58 .lineNoCov { background-color: #ffe0e0; } 59 div.code { 60 border: 1px solid gray; 61 font-size: 12px; 62 } 57 63 pre.code { 58 64 font-family: monospace; 59 65 font-size: 12px; 60 66 white-space: pre; 61 border: 1px solid gray;67 padding: 0; margin: 0; 62 68 } 63 69 -
branches/1.3/coverager/coverager.php
r615 r623 114 114 $lines = explode('<br />', $lines); 115 115 $last = array_pop($lines); 116 $lines[count($lines) - 1] .= $last; 116 117 $filecov = sprint_cov($fileinfo['cov'], $lines, false); 117 $filecov .= $last;118 118 unset($source); 119 119 } … … 325 325 } 326 326 if (isset($cov[$offs])) { 327 $lines[$l] = sprintf("<li class=\"line%sCov\"> %s\t%s\n</li>"327 $lines[$l] = sprintf("<li class=\"line%sCov\"><pre class=\"code\"> %s\t%s\n</pre></li>" 328 328 , $cov[$offs] ? '' : 'No' 329 329 , $cov[$offs] … … 331 331 } 332 332 else { 333 $lines[$l] = "<li> \t$line\n</li>";333 $lines[$l] = "<li><pre class=\"code\">\t$line\n</pre></li>"; 334 334 } 335 335 } -
branches/1.3/coverager/coverager.tpl.php
r600 r623 1 <!DOCTYPE HTMLPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 3 <head> … … 56 56 $l_tds = _T("TODO"); 57 57 return <<<EOS 58 <table align="center" cellpadding="2" cellspacing="0" border="0" class="cycles"> 58 <div class="table-center"> 59 <table cellpadding="2" cellspacing="0" border="0" class="cycles center"> 59 60 <tr> 60 61 <th>{$l_dir}</th><th>{$l_per}</th><th>{$l_hit}</th><th>{$l_lns}</th><th>{$l_tds}</th> … … 105 106 return <<<EOS 106 107 </table> 108 </div> 107 109 EOS; 108 110 } … … 117 119 $l_lns = _T("Lines"); 118 120 return <<<EOS 119 <br>120 <table align="center" cellpadding="2" cellspacing="0" border="0" class="cycles">121 <div class="center-table"> 122 <table cellpadding="2" cellspacing="0" border="0" class="cycles center"> 121 123 <tr> 122 124 <th>{$l_fil}</th><th>{$l_per}</th><th>{$l_hit}</th><th>{$l_lns}</th> … … 162 164 return <<<EOS 163 165 </table> 166 </div> 164 167 EOS; 165 168 } … … 172 175 $path_html = htmlspecialchars($path); 173 176 echo <<<EOS 174 <a href="?">$l_root</a> $path<br /> 177 <div> 178 <a href="?">$l_root</a> $path<br /> 179 </div> 175 180 EOS; 176 181 echo dir_head($dirinfo); … … 199 204 $dir_html = htmlspecialchars($dir); 200 205 echo <<<EOS 201 <a href="?">$l_root</a> <a href="?path={$dir_url}">{$dir_html}</a>/<strong>{$filename}</strong><br /> 206 <div> 207 <a href="?">$l_root</a> <a href="?path={$dir_url}">{$dir_html}</a>/<strong>{$filename}</strong><br /> 208 </div> 202 209 EOS; 203 210 … … 209 216 $tplfile_html = htmlspecialchars($tplfile); 210 217 echo <<<EOS 211 <a href="#tpl">{$tplfile_html}</a><br /> 218 <div> 219 <a href="#tpl">{$tplfile_html}</a><br /> 220 </div> 212 221 EOS; 213 222 } … … 216 225 } 217 226 echo <<<EOS 218 <pre class="code"><ol>{$filecov}</ol></pre> 227 <div class="code"> 228 <ol>{$filecov}</ol> 229 </div> 219 230 EOS; 220 231 if ($tplfile) { 221 232 echo <<<EOS 222 233 <a name="tpl">{$tplfile}</a> 223 <pre class="code"><ol>{$tplcov}</ol></pre> 234 <div class="code"> 235 <ol>{$tplcov}</ol> 236 </div> 224 237 EOS; 225 238 } -
branches/1.3/mkopcode_spec.awk
r394 r623 15 15 exit 16 16 } 17 printf "\tOPSPEC(%10s, %10s, %10s, %10s)\n", array[1], array[2], array[3], array[4] 17 comment = ""; 18 if (match($0, /\/\* (\d+) \*\//, comments)) { 19 comment = comments[1]; 20 } 21 printf "\tOPSPEC(%10s, %10s, %10s, %10s)%s\n", array[1], array[2], array[3], array[4], comment; 18 22 next 19 23 } -
branches/1.3/phpdc.phpr
r604 r623 13 13 } 14 14 15 $dc = &new Decompiler();15 $dc = new Decompiler(); 16 16 if (isset($argv[1])) { 17 17 $dc->decompileFile($argv[1]); -
branches/1.3/processor/hashtable.m4
r622 r623 123 123 fprintf(stderr, "$2:\""); 124 124 xc_dprint_str_len(BUCKET_KEY_S(b), BUCKET_KEY_SIZE(b)); 125 fprintf(stderr, "\" %d:h=%lu ", BUCKET_KEY_SIZE(b), b->h);125 fprintf(stderr, "\" %d:h=%lu ", BUCKET_KEY_SIZE(b), b->h); 126 126 ') 127 127 if (sizeof(void *) == sizeof($2)) { -
branches/1.3/processor/processor.m4
r622 r623 211 211 dnl fprintf(stderr, "copy from %p to %p\n", src[0], dst[0]); 212 212 ') 213 IFDPRINT(`INDENT()`'fprintf(stderr, "[%p] ", src[0]);')213 IFDPRINT(`INDENT()`'fprintf(stderr, "[%p] ", src[0]);') 214 214 STRUCT_P_EX(zval, dst[0], src[0], `[0]', `', ` ') 215 215 FIXPOINTER_EX(zval, dst[0]) … … 475 475 IFCOPY(` 476 476 switch (src->opcode) { 477 #ifdef ZEND_GOTO 478 case ZEND_GOTO: 479 #endif 477 480 case ZEND_JMP: 478 481 dst->op1.u.jmp_addr = processor->active_opcodes_dst + (src->op1.u.jmp_addr - processor->active_opcodes_src); -
branches/1.3/processor/struct.m4
r394 r623 60 60 61 61 IFDPRINT(` 62 fprintf(stderr, "%s", " {\n");62 fprintf(stderr, "%s", "{\n"); 63 63 indent ++; 64 64 ') … … 146 146 DBG(`$0($*)') 147 147 if (src->$2) { 148 IFDPRINT(`INDENT()`'fprintf(stderr, "$1:$2 ");')148 IFDPRINT(`INDENT()`'fprintf(stderr, "$1:$2 ");') 149 149 STRUCT_P_EX(`$1', `dst->$2', `src->$2', `$2', `$3') 150 150 } … … 160 160 DBG(`$0($*)') 161 161 assert(sizeof($1) == sizeof(src->$2)); 162 IFDPRINT(`INDENT()`'fprintf(stderr, "$1:$2 ");')162 IFDPRINT(`INDENT()`'fprintf(stderr, "$1:$2 ");') 163 163 STRUCT_P_EX(`$1', `dst->$2', `src->$2', `$2', `$3', `&') 164 164 DONE(`$2') -
branches/1.3/run-xcachetest
r604 r623 19 19 if test -z "$TEST_PHP_USER" ; then 20 20 TEST_PHP_USER="$PHP_SRC/tests" 21 for i in Zend ZendEngine2 ext/standard/tests ext/reflection/tests ; do21 for i in Zend ZendEngine2 ext/standard/tests ext/reflection/tests ext/spl/tests; do 22 22 if test -d "$PHP_SRC/$i" ; then 23 23 TEST_PHP_USER="$TEST_PHP_USER,$PHP_SRC/$i" -
branches/1.3/utils.c
r622 r623 144 144 #ifdef ZEND_ENGINE_2_1 145 145 switch (opline->opcode) { 146 #ifdef ZEND_GOTO 147 case ZEND_GOTO: 148 #endif 146 149 case ZEND_JMP: 147 150 opline->op1.u.opline_num = opline->op1.u.jmp_addr - op_array->opcodes; … … 194 197 #ifdef ZEND_ENGINE_2_1 195 198 switch (opline->opcode) { 199 #ifdef ZEND_GOTO 200 case ZEND_GOTO: 201 #endif 196 202 case ZEND_JMP: 197 203 assert(opline->op1.u.opline_num < op_array->last); … … 294 300 while (opline < end) { 295 301 switch (opline->opcode) { 302 #ifdef ZEND_GOTO 303 case ZEND_GOTO: 304 #endif 296 305 case ZEND_JMP: 297 306 next = begin + opline->op1.u.opline_num; -
branches/1.3/utils.h
r622 r623 80 80 typedef struct { 81 81 int alloc; 82 int orig_user_error_handler_error_reporting;83 82 char *filename; 84 83 … … 98 97 Bucket *tmp_internal_function_tail; 99 98 Bucket *tmp_internal_class_tail; 99 100 #ifdef E_STRICT 101 int orig_user_error_handler_error_reporting; 102 #endif 100 103 } xc_sandbox_t; 101 104 -
branches/1.3/xcache-test.ini
r622 r623 1 auto_globals_jit = Off2 1 memory_limit = 256M 3 2 -
branches/1.3/xcache.c
r622 r623 87 87 88 88 static zend_bool xc_initized = 0; 89 static time_t xc_init_time = 0; 90 static long unsigned xc_init_instance_id = 0; 91 #ifdef ZTS 92 static long unsigned xc_init_instance_subid = 0; 93 #endif 89 94 static zend_compile_file_t *origin_compile_file = NULL; 90 95 static zend_compile_file_t *old_compile_file = NULL; … … 247 252 /* }}} */ 248 253 #endif 254 static inline zend_uint advance_wrapped(zend_uint val, zend_uint count) /* {{{ */ 255 { 256 if (val + 1 >= count) { 257 return 0; 258 } 259 return val + 1; 260 } 261 /* }}} */ 262 static void xc_counters_inc(time_t *curtime, zend_uint *curslot, time_t period, zend_ulong *counters, zend_uint count TSRMLS_DC) /* {{{ */ 263 { 264 time_t n = XG(request_time) / period; 265 if (*curtime != n) { 266 zend_uint target_slot = n % count; 267 if (n - *curtime > period) { 268 memset(counters, 0, sizeof(counters[0]) * count); 269 } 270 else { 271 zend_uint slot; 272 for (slot = advance_wrapped(*curslot, count); 273 slot != target_slot; 274 slot = advance_wrapped(slot, count)) { 275 counters[slot] = 0; 276 } 277 counters[target_slot] = 0; 278 } 279 *curtime = n; 280 *curslot = target_slot; 281 } 282 counters[*curslot] ++; 283 } 284 /* }}} */ 285 static void xc_cache_hit_dmz(xc_cache_t *cache TSRMLS_DC) /* {{{ */ 286 { 287 cache->hits ++; 288 289 xc_counters_inc(&cache->hits_by_hour_cur_time 290 , &cache->hits_by_hour_cur_slot, 60 * 60 291 , cache->hits_by_hour 292 , sizeof(cache->hits_by_hour) / sizeof(cache->hits_by_hour[0]) 293 TSRMLS_CC); 294 295 xc_counters_inc(&cache->hits_by_second_cur_time 296 , &cache->hits_by_second_cur_slot 297 , 1 298 , cache->hits_by_second 299 , sizeof(cache->hits_by_second) / sizeof(cache->hits_by_second[0]) 300 TSRMLS_CC); 301 } 302 /* }}} */ 249 303 250 304 /* helper function that loop through each entry */ … … 311 365 int i, c; 312 366 313 if (!xc_php_ttl || !xc_php_gc_interval ) {367 if (!xc_php_ttl || !xc_php_gc_interval || !xc_php_caches) { 314 368 return; 315 369 } … … 324 378 int i, c; 325 379 326 if (!xc_var_gc_interval ) {380 if (!xc_var_gc_interval || !xc_var_caches) { 327 381 return; 328 382 } … … 372 426 int i, c; 373 427 374 for (i = 0, c = xc_php_hcache.size; i < c; i ++) { 375 xc_gc_deletes_one(xc_php_caches[i] TSRMLS_CC); 376 } 377 378 for (i = 0, c = xc_var_hcache.size; i < c; i ++) { 379 xc_gc_deletes_one(xc_var_caches[i] TSRMLS_CC); 428 if (xc_php_caches) { 429 for (i = 0, c = xc_php_hcache.size; i < c; i ++) { 430 xc_gc_deletes_one(xc_php_caches[i] TSRMLS_CC); 431 } 432 } 433 434 if (xc_var_caches) { 435 for (i = 0, c = xc_var_hcache.size; i < c; i ++) { 436 xc_gc_deletes_one(xc_var_caches[i] TSRMLS_CC); 437 } 380 438 } 381 439 } … … 385 443 static void xc_fillinfo_dmz(int cachetype, xc_cache_t *cache, zval *return_value TSRMLS_DC) /* {{{ */ 386 444 { 387 zval *blocks; 445 zval *blocks, *hits; 446 int i; 388 447 const xc_block_t *b; 389 448 #ifndef NDEBUG … … 417 476 add_assoc_null_ex(return_value, ZEND_STRS("gc")); 418 477 } 478 MAKE_STD_ZVAL(hits); 479 array_init(hits); 480 for (i = 0; i < sizeof(cache->hits_by_hour) / sizeof(cache->hits_by_hour[0]); i ++) { 481 add_next_index_long(hits, (long) cache->hits_by_hour[i]); 482 } 483 add_assoc_zval_ex(return_value, ZEND_STRS("hits_by_hour"), hits); 484 485 MAKE_STD_ZVAL(hits); 486 array_init(hits); 487 for (i = 0; i < sizeof(cache->hits_by_second) / sizeof(cache->hits_by_second[0]); i ++) { 488 add_next_index_long(hits, (long) cache->hits_by_second[i]); 489 } 490 add_assoc_zval_ex(return_value, ZEND_STRS("hits_by_second"), hits); 419 491 420 492 MAKE_STD_ZVAL(blocks); … … 640 712 static void xc_entry_unholds(TSRMLS_D) /* {{{ */ 641 713 { 642 xc_entry_unholds_real(XG(php_holds), xc_php_caches, xc_php_hcache.size TSRMLS_CC); 643 xc_entry_unholds_real(XG(var_holds), xc_var_caches, xc_var_hcache.size TSRMLS_CC); 714 if (xc_php_caches) { 715 xc_entry_unholds_real(XG(php_holds), xc_php_caches, xc_php_hcache.size TSRMLS_CC); 716 } 717 718 if (xc_var_caches) { 719 xc_entry_unholds_real(XG(var_holds), xc_var_caches, xc_var_hcache.size TSRMLS_CC); 720 } 644 721 } 645 722 /* }}} */ … … 914 991 TRACE("found %s, catch it", stored_xce->name.str.val); 915 992 xc_entry_hold_php_dmz(stored_xce TSRMLS_CC); 916 cache->hits ++;993 xc_cache_hit_dmz(cache); 917 994 break; 918 995 } … … 1222 1299 xc_shm_t *shm; 1223 1300 int i; 1224 if (!xc_initized) { 1225 return 0; 1226 } 1227 for (i = 0; i < xc_php_hcache.size; i ++) { 1228 shm = xc_php_caches[i]->shm; 1229 if (shm->handlers->is_readwrite(shm, p)) { 1230 return 1; 1231 } 1232 } 1233 for (i = 0; i < xc_var_hcache.size; i ++) { 1234 shm = xc_var_caches[i]->shm; 1235 if (shm->handlers->is_readwrite(shm, p)) { 1236 return 1; 1301 1302 if (xc_php_caches) { 1303 for (i = 0; i < xc_php_hcache.size; i ++) { 1304 shm = xc_php_caches[i]->shm; 1305 if (shm->handlers->is_readwrite(shm, p)) { 1306 return 1; 1307 } 1308 } 1309 } 1310 1311 if (xc_var_caches) { 1312 for (i = 0; i < xc_var_hcache.size; i ++) { 1313 shm = xc_var_caches[i]->shm; 1314 if (shm->handlers->is_readwrite(shm, p)) { 1315 return 1; 1316 } 1237 1317 } 1238 1318 } … … 1244 1324 xc_shm_t *shm; 1245 1325 int i; 1246 if (!xc_initized) { 1247 return 0; 1248 } 1249 for (i = 0; i < xc_php_hcache.size; i ++) { 1250 shm = xc_php_caches[i]->shm; 1251 if (shm->handlers->is_readonly(shm, p)) { 1252 return 1; 1253 } 1254 } 1255 for (i = 0; i < xc_var_hcache.size; i ++) { 1256 shm = xc_var_caches[i]->shm; 1257 if (shm->handlers->is_readonly(shm, p)) { 1258 return 1; 1326 1327 if (xc_php_caches) { 1328 for (i = 0; i < xc_php_hcache.size; i ++) { 1329 shm = xc_php_caches[i]->shm; 1330 if (shm->handlers->is_readonly(shm, p)) { 1331 return 1; 1332 } 1333 } 1334 } 1335 1336 if (xc_var_caches) { 1337 for (i = 0; i < xc_var_hcache.size; i ++) { 1338 shm = xc_var_caches[i]->shm; 1339 if (shm->handlers->is_readonly(shm, p)) { 1340 return 1; 1341 } 1259 1342 } 1260 1343 } … … 1515 1598 XG(internal_table_copied) = 1; 1516 1599 } 1517 if (xc_php_ hcache.size&& !XG(php_holds)) {1600 if (xc_php_caches && !XG(php_holds)) { 1518 1601 XG(php_holds) = calloc(xc_php_hcache.size, sizeof(xc_stack_t)); 1519 1602 for (i = 0; i < xc_php_hcache.size; i ++) { … … 1522 1605 } 1523 1606 1524 if (xc_ initized && xc_var_hcache.size&& !XG(var_holds)) {1607 if (xc_var_caches && !XG(var_holds)) { 1525 1608 XG(var_holds) = calloc(xc_var_hcache.size, sizeof(xc_stack_t)); 1526 1609 for (i = 0; i < xc_var_hcache.size; i ++) { … … 1675 1758 } 1676 1759 1677 #define STR " WWW-authenticate: Basic Realm=\"XCache Administration\""1760 #define STR "HTTP/1.0 401 Unauthorized" 1678 1761 sapi_add_header_ex(STR, sizeof(STR) - 1, 1, 1 TSRMLS_CC); 1679 1762 #undef STR 1680 #define STR " HTTP/1.0 401 Unauthorized"1763 #define STR "WWW-authenticate: Basic Realm=\"XCache Administration\"" 1681 1764 sapi_add_header_ex(STR, sizeof(STR) - 1, 1, 1 TSRMLS_CC); 1682 1765 #undef STR … … 1884 1967 } LEAVE_LOCK(xce.cache); 1885 1968 if (found) { 1886 xc e.cache->hits ++;1969 xc_cache_hit_dmz(xce.cache TSRMLS_CC); 1887 1970 } 1888 1971 else { … … 1965 2048 } LEAVE_LOCK(xce.cache); 1966 2049 if (found) { 1967 xc e.cache->hits ++;2050 xc_cache_hit_dmz(xce.cache TSRMLS_CC); 1968 2051 } 1969 2052 else { … … 2098 2181 } 2099 2182 /* }}} */ 2183 #ifdef HAVE_XCACHE_DPRINT 2184 /* {{{ proto bool xcache_dprint(mixed value) 2185 Prints variable (or value) internal struct (debug only) */ 2186 PHP_FUNCTION(xcache_dprint) 2187 { 2188 zval *value; 2189 2190 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) { 2191 return; 2192 } 2193 xc_dprint_zval(value, 0 TSRMLS_CC); 2194 } 2195 /* }}} */ 2196 #endif 2100 2197 /* {{{ proto string xcache_asm(string filename) 2101 2198 */ … … 2323 2420 PHP_FE(xcache_isset, NULL) 2324 2421 PHP_FE(xcache_unset, NULL) 2422 #ifdef HAVE_XCACHE_DPRINT 2423 PHP_FE(xcache_dprint, NULL) 2424 #endif 2325 2425 {NULL, NULL, NULL} 2326 2426 }; … … 2460 2560 php_info_print_table_row(2, "Modules Built", XCACHE_MODULES); 2461 2561 php_info_print_table_row(2, "Readonly Protection", xc_readonly_protection ? "enabled" : "N/A"); 2562 ptr = php_format_date("Y-m-d H:i:s", sizeof("Y-m-d H:i:s") - 1, xc_init_time, 1 TSRMLS_CC); 2563 php_info_print_table_row(2, "Cache Init Time", ptr); 2564 efree(ptr); 2565 2566 #ifdef ZTS 2567 snprintf(buf, sizeof(buf), "%lu.%lu", xc_init_instance_id, xc_init_instance_subid); 2568 #else 2569 snprintf(buf, sizeof(buf), "%lu", xc_init_instance_id); 2570 #endif 2571 php_info_print_table_row(2, "Cache Instance Id", buf); 2462 2572 2463 2573 if (xc_php_size) { … … 2694 2804 } 2695 2805 xc_initized = 1; 2806 xc_init_time = time(NULL); 2807 xc_init_instance_id = getpid(); 2808 #ifdef ZTS 2809 xc_init_instance_subid = tsrm_thread_id(); 2810 #endif 2696 2811 } 2697 2812 -
branches/1.3/xcache.h
r622 r623 220 220 time_t last_gc_deletes; 221 221 time_t last_gc_expires; 222 223 time_t hits_by_hour_cur_time; 224 zend_uint hits_by_hour_cur_slot; 225 zend_ulong hits_by_hour[24]; 226 time_t hits_by_second_cur_time; 227 zend_uint hits_by_second_cur_slot; 228 zend_ulong hits_by_second[5]; 222 229 } xc_cache_t; 223 230 /* }}} */ -
branches/1.3/xcache.ini
r604 r623 23 23 ; to disable: xcache.size=0 24 24 ; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows 25 xcache.size = 0M25 xcache.size = 60M 26 26 ; set to cpu count (cat /proc/cpuinfo |grep -c processor) 27 27 xcache.count = 1 … … 34 34 35 35 ; same as aboves but for variable cache 36 xcache.var_size = 0M36 xcache.var_size = 4M 37 37 xcache.var_count = 1 38 38 xcache.var_slots = 8K

