php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Patch opcode_view_patch for APC Bug #61942Patch version 2012-05-04 19:24 UTC Return to Bug #61942 | Download this patchThis patch renders other patches obsolete Obsolete patches: Patch Revisions:
Developer: bug@s-seven.netdiff --git a/APC-3.1.10/apc.php b/apc.php old mode 100644 new mode 100644 index adf8290..837eea2 --- a/build/APC-3.1.10/APC-3.1.10/apc.php +++ b/apc.php @@ -51,6 +51,9 @@ defaults('GRAPH_SIZE',200); // Image size //defaults('PROXY', 'tcp://127.0.0.1:8080'); +// %s for full path to filename... +//defaults('OPCODE_COMMAND', 'php -dvld.active=1 -dvld.execute=0 -dvld.dump_paths=0 -dvld.verbosity=0 %s 2>&1'); + ////////// END OF DEFAULT CONFIG AREA ///////////////////////////////////////////////////////////// @@ -82,6 +85,7 @@ $vardom=array( 'CC' => '/^[01]$/', // clear cache requested 'DU' => '/^.*$/', // Delete User Key 'SH' => '/^[a-z0-9]+$/', // shared object description + 'OP' => '/^[01]$/', // opcode display 'IMG' => '/^[123]$/', // image to generate 'LO' => '/^1$/', // login requested @@ -981,6 +985,7 @@ EOB; // hide all path entries if not logged in $value=preg_replace('/^.*(\\/|\\\\)/','<i><hidden></i>/',$value); } + elseif ($k == "filename") $opcode_filename = $value; if ($k == "num_hits") { $value=sprintf("%s (%.2f%%)",$value,$value*100/$cache['num_hits']); @@ -1009,6 +1014,29 @@ EOB; </tbody></table> </div> EOB; + +if ($AUTHENTICATED) +{ + if (defined('OPCODE_COMMAND') && OPCODE_COMMAND && isset($opcode_filename) && $opcode_filename) + { + clearstatcache(); + if (file_exists($opcode_filename)) + { + echo "<hr><p><ol class=menu>"; + echo sprintf("<li><a %s href=\"{$MY_SELF}&OB={$MYREQUEST['OB']}&SH={$MYREQUEST['SH']}&OP=%d\">%s opcode</a></li>", + $MYREQUEST['OP']?'class="child_active"':'', (int)!$MYREQUEST['OP'], $MYREQUEST['OP']?'Hide':'Show'); + echo"</ol></p><hr>"; + + if ($MYREQUEST['OP'] == 1) + { + echo "<pre>"; + system(sprintf(OPCODE_COMMAND, $opcode_filename)); + echo "</pre>"; + } + } + } +} + break; } |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Sun Dec 22 05:01:30 2024 UTC |