Changeset 206
- Timestamp:
- 05/04/06 15:25:49 (2 years ago)
- Files:
-
- eaccelerator/trunk/AUTHORS (modified) (1 diff)
- eaccelerator/trunk/ChangeLog (modified) (1 diff)
- eaccelerator/trunk/PHP_Highlight.php (added)
- eaccelerator/trunk/README (modified) (1 diff)
- eaccelerator/trunk/dasm.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/trunk/AUTHORS
r162 r206 10 10 - Frank Alcantara <frankalcantara at users.sourceforge.net> 11 11 12 Code used from: 13 Aidan Lister <aidan [ett] php [dutt] net> - The PHP_Highlight.php script 14 12 15 eAccelerator is based on Turck MMCache, written by 13 16 Dmitry Stogov <dstogov at users.sourceforge.net> eaccelerator/trunk/ChangeLog
r205 r206 3 3 * Don't store the doc_comments in op_array and class_entry. They are 4 4 useless. this should reduce memory footprint. 5 * Included patch from Stadler from ticket #23. It adds a nice menu 6 and code highlighting. 5 7 6 8 2006-04-13 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> eaccelerator/trunk/README
r197 r206 242 242 243 243 When you compile eAccelerator with --with-eaccelerator-disassembler you need 244 to place the dasm.php file also in the same directory as the control.php file. 244 to place the dasm.php and PHP_Highlight.php file also in the same directory 245 as the control.php file. 245 246 You can set the username and password needed to access this file at the top 246 247 of the file. eaccelerator/trunk/dasm.php
r198 r206 65 65 input {width: 150px} 66 66 h1 {width: 800px; border: 1px solid #000000; margin-left: auto; margin-right: auto; background-color: #9999cc;} 67 .l {border: 1px solid #000000; text-align: left; width: 800px; margin: auto; font-size: 65%;} 68 .l h2 {font-size: 200%; text-align: center; } 67 69 </style> 68 70 </head> … … 80 82 } 81 83 82 $source = explode("\n", htmlentities(file_get_contents($_GET['file']), ENT_QUOTES, 'UTF-8')); 83 // $source = explode("\n", file_get_contents($_GET['file'])); 84 require_once('PHP_Highlight.php'); 85 $h = new PHP_Highlight; 86 $h->loadFile($_GET['file']); 87 $source = $h->toArray(); 84 88 85 89 /* what do we need to do ? */ … … 89 93 $show = $_GET['show']; 90 94 } 95 96 print_layout(); 91 97 switch ($show) { 92 98 case 'main': … … 98 104 } 99 105 break; 100 case 'classes': 101 if (is_array($asm['classes'][$_GET['name']])) { 102 print_class($_GET['name'], $asm['classes'][$_GET['name']]); 103 } 106 case 'methods': 104 107 if (isset($_GET['method']) && is_array($asm['classes'][$_GET['name']][$_GET['method']])) { 105 108 print_method($_GET['method'], $asm['classes'][$_GET['name']][$_GET['method']]); 106 109 } 107 110 break; 108 default:109 print_layout();110 111 } 111 112 … … 121 122 /* {{{ print_op_array */ 122 123 function print_op_array($op_array) { ?> 124 <h2>Global file op_array</h2> 123 125 <table> 124 126 <tr> … … 149 151 if ($code != '') { 150 152 echo "<tr>\n"; 151 // echo '<td class="source" colspan="7"><pre>' . highlight_string($code, true) . "</pre></td>\n";152 153 echo '<td class="source" colspan="7"><pre>' . $code . "</pre></td>\n"; 153 154 echo "</tr>\n"; … … 174 175 if ($code != '') { 175 176 echo "<tr>\n"; 176 // echo '<td class="source" colspan="7"><pre>' . highlight_string($code, true) . "</pre></td>\n";177 177 echo '<td class="source" colspan="7"><pre>' . $code . "</pre></td>\n"; 178 178 echo "</tr>\n"; … … 204 204 global $asm, $file; 205 205 echo "<h2>Script layout</h2>\n"; 206 echo "<div style=\"text-align: left; width: 800px\">\n";206 echo "<div class=\"l\">\n"; 207 207 echo "<ul>\n"; 208 208 if (isset($asm['op_array'])) { … … 218 218 if (isset($asm['classes']) && count($asm['classes']) > 0) { 219 219 echo "<li>Classes<ul>\n"; 220 foreach ($asm['classes'] as $name => $data) { 221 echo "<li><a href=\"?file=$file&show=classes&name=$name\">$name</a></li>"; 220 foreach ($asm['classes'] as $name => $class) { 221 echo "<li>$name<ul><li style=\"list-style-type: none\">Methods</li>\n"; 222 foreach (array_keys($class) as $method) { 223 echo "<li><a href=\"?file=$file&show=methods&name=$name&method=$method\">$method</a></li>\n"; 224 } 225 echo "</ul></li>\n"; 222 226 } 223 227 echo "</ul></li>\n"; … … 227 231 echo "</div>\n"; 228 232 } 229 /* }}} */230 231 /* {{{ print a the class layout */232 function print_class($name, $class) {233 global $file;234 echo "<h2>Class $name</h2>";235 echo "<div style=\"text-align: left; width: 800px\"><ul>\n";236 foreach($class as $method => $data) {237 echo "<li><a href=\"?file=$file&show=classes&name=$name&method=$method\">$method</a></li>\n";238 }239 echo "</ul></div>";240 }241 233 /* }}} */ 242 234 ?>