php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61942
Patch opcode_view_patch revision 2012-05-04 19:24 UTC by bug at s-seven dot net
revision 2012-05-04 19:16 UTC by bug at s-seven dot net
revision 2012-05-04 19:10 UTC by bug at s-seven dot net

Patch opcode_view_patch for APC Bug #61942

Patch version 2012-05-04 19:16 UTC

Return to Bug #61942 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: bug@s-seven.net

diff --git a/APC-3.1.10/apc.php b/apc.php
old mode 100644
new mode 100755
index adf8290..e3edc9f
--- a/APC-3.1.10/apc.php
+++ b/apc.php
@@ -30,7 +30,7 @@ if (file_exists("apc.conf.php")) include("apc.conf.php");
 
 ////////// BEGIN OF DEFAULT CONFIG AREA ///////////////////////////////////////////////////////////
 
-defaults('USE_AUTHENTICATION',1);                      // Use (internal) authentication - best choice if 
+defaults('USE_AUTHENTICATION',0);                      // Use (internal) authentication - best choice if
                                                                                        // no other authentication is available
                                                                                        // If set to 0:
                                                                                        //  There will be no further authentication. You 
@@ -51,6 +51,9 @@ defaults('GRAPH_SIZE',200);                                   // Image size
 
 //defaults('PROXY', 'tcp://127.0.0.1:8080');
 
+//defaults('OPCODE_COMMAND', 'php -dvld.active=1 -dvld.execute=0 -dvld.dump_paths=0 -dvld.verbosity=0 %s 2>&1'); // %s for full path to filename
+
 ////////// 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>&lt;hidden&gt;</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;
        }
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC