Index: trunk/extensions/APC/APCCacheMode.php |
— | — | @@ -37,6 +37,7 @@ |
38 | 38 | foreach( $cache[$list] as $entry ) { |
39 | 39 | if (md5($entry[$this->fieldKey]) !== $object) continue; |
40 | 40 | |
| 41 | + $size = 0; |
41 | 42 | foreach($entry as $key => $value) { |
42 | 43 | switch ($key) { |
43 | 44 | case 'num_hits': |
— | — | @@ -49,6 +50,8 @@ |
50 | 51 | $value = wfMsg( 'viewapc-display-no-delete' ); |
51 | 52 | break; |
52 | 53 | } |
| 54 | + case 'mem_size': |
| 55 | + $size = $value; |
53 | 56 | default: |
54 | 57 | $value = $this->formatValue( $key, $value ); |
55 | 58 | } |
— | — | @@ -60,10 +63,16 @@ |
61 | 64 | } |
62 | 65 | |
63 | 66 | if ( $this->userMode ) { |
64 | | - $value = var_export(apc_fetch($entry[$this->fieldKey]),true); |
65 | | - $s .= APCUtils::tableRow( $r=1-$r, |
| 67 | + if ( $size > 1024*1024 ) { |
| 68 | + $s .= APCUtils::tableRow( $r=1-$r, |
66 | 69 | wfMsgHtml( 'viewapc-display-stored-value' ), |
67 | | - Xml::element( 'pre', null, $value ) ); |
| 70 | + wfMsgExt( 'viewapc-display-too-big', 'parseinline' ) ); |
| 71 | + } else { |
| 72 | + $value = var_export(apc_fetch($entry[$this->fieldKey]),true); |
| 73 | + $s .= APCUtils::tableRow( $r=1-$r, |
| 74 | + wfMsgHtml( 'viewapc-display-stored-value' ), |
| 75 | + Xml::element( 'pre', null, $value ) ); |
| 76 | + } |
68 | 77 | } |
69 | 78 | } |
70 | 79 | } |
Index: trunk/extensions/APC/ViewAPC.i18n.php |
— | — | @@ -79,6 +79,7 @@ |
80 | 80 | 'viewapc-display-ref_count' => 'Reference count', |
81 | 81 | 'viewapc-display-mem_size' => 'Size', |
82 | 82 | 'viewapc-display-stored-value' => 'Stored value', |
| 83 | + 'viewapc-display-too-big' => "''Content is too large to show.''", |
83 | 84 | |
84 | 85 | 'viewapc-ls-options-legend' => 'Options', |
85 | 86 | 'viewapc-ls-options' => 'Scope: $1 Sorting: $2$3$4 Search: $5 $6', |