'Status', 1 => 'Script Cache');
foreach ($items as $i => $item) {
echo '';
}
?>
loadFile($_GET['file']);
$source = $h->toArray();
/* what do we need to do ? */
if (!isset($_GET['show'])) {
$show = '';
} else {
$show = $_GET['show'];
}
print_layout();
switch ($show) {
case 'main':
print_op_array($asm['op_array']);
break;
case 'functions':
if (is_array($asm['functions'][$_GET['name']])) {
print_function($_GET['name'], $asm['functions'][$_GET['name']]);
}
break;
case 'methods':
if (isset($_GET['method']) && is_array($asm['classes'][$_GET['name']][$_GET['method']])) {
print_method($_GET['method'], $asm['classes'][$_GET['name']][$_GET['method']]);
}
break;
}
/* {{{ convert_string */
function convert_string($string, $length) {
if (strlen($string) > $length) {
$string = substr($string, 0, $length -4).' ...';
}
return htmlspecialchars($string);
}
/* }}} */
/* {{{ print_op_array */
function print_op_array($op_array) { ?>
Global file op_array
| N |
Line |
Opcode |
Extented value |
Op1 |
Op2 |
Result |
\n";
echo '' . $code . " | \n";
echo "\n";
}
?>
|
|
|
|
|
|
|
\n";
echo '' . $code . " | \n";
echo "\n";
}
}
?>
Function: $name";
print_op_array($op_array);
}
/* }}} */
/* {{{ print_method: print the given method */
function print_method($name, $op_array) {
echo "
Method: $name
";
print_op_array($op_array);
}
/* }}} */
/* {{{ print_layout: print the layout of this script */
function print_layout() {
global $asm, $file;
echo "
Script layout
\n";
echo "
\n";
echo "
\n";
if (isset($asm['op_array'])) {
echo "- Global file op_array
";
}
if (isset($asm['functions']) && count($asm['functions']) > 0) {
echo "- Functions
\n";
foreach ($asm['functions'] as $name => $data) {
echo "- $name
";
}
echo "
\n";
}
if (isset($asm['classes']) && count($asm['classes']) > 0) {
echo "- Classes
\n";
foreach ($asm['classes'] as $name => $class) {
echo "- $name
- Methods
\n";
foreach (array_keys($class) as $method) {
echo "- $method
\n";
}
echo "
\n";
}
echo "
\n";
}
echo "
\n";
echo "
\n";
}
/* }}} */
?>