Completed
Push — 0.x ( a2b070...a5c73d )
by Akihito
09:21
created
src/Bootstrap/Bootstrap.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,6 @@
 block discarded – undo
9 9
 use Composer\Autoload\ClassLoader;
10 10
 use Doctrine\Common\Annotations\AnnotationRegistry;
11 11
 use Doctrine\Common\Annotations\AnnotationReader;
12
-use Doctrine\Common\Cache\ApcCache;
13
-use Doctrine\Common\Cache\FilesystemCache;
14 12
 use BEAR\Package\Module\Di\DiCompilerProvider;
15 13
 use Doctrine\Common\Cache\Cache;
16 14
 
Please login to merge, or discard this patch.
src/Dev/Debug/ExceptionHandle/ExceptionHandler.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
13 13
 use BEAR\Resource\Exception\ResourceNotFound;
14 14
 use BEAR\Resource\Exception\Scheme;
15 15
 use BEAR\Resource\Exception\Uri;
16
-use BEAR\Sunday\Exception\LogicException;
17 16
 use BEAR\Sunday\Extension\WebResponse\ResponseInterface;
18 17
 use BEAR\Sunday\Inject\LogDirInject;
19 18
 use Exception;
Please login to merge, or discard this patch.
src/Module/Cache/Interceptor/CacheUpdater.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 use Ray\Aop\MethodInterceptor;
10 10
 use Ray\Aop\MethodInvocation;
11 11
 use Ray\Di\Di\Inject;
12
-use Ray\Di\Di\Named;
13 12
 use ReflectionMethod;
14 13
 use Doctrine\Common\Cache\Cache;
15 14
 
Please login to merge, or discard this patch.
src/Module/Form/AuraForm/AuraFormTrait.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 use Ray\Aop\MethodInvocation;
11 11
 use Aura\Input\Form;
12 12
 use Ray\Di\Di\Inject;
13
-use Ray\Di\Di\Named;
14 13
 use Aura\Session\Manager as Session;
15 14
 use BEAR\Package\Module\Session\AuraSession\AntiCsrf;
16 15
 
Please login to merge, or discard this patch.
src/Module/Resource/ResourceGraphModule.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -6,10 +6,7 @@
 block discarded – undo
6 6
  */
7 7
 namespace BEAR\Package\Module\Resource;
8 8
 
9
-use BEAR\Package\Provide as ProvideModule;
10
-use BEAR\Sunday\Module as SundayModule;
11 9
 use Ray\Di\AbstractModule;
12
-use Ray\Di\Scope;
13 10
 
14 11
 class ResourceGraphModule extends AbstractModule
15 12
 {
Please login to merge, or discard this patch.
src/Module/Resource/SignalParamProvider.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -10,11 +10,9 @@
 block discarded – undo
10 10
 use Aura\Signal\Manager;
11 11
 use Aura\Signal\ResultCollection;
12 12
 use Aura\Signal\ResultFactory;
13
-use BEAR\Package\Provide as ProvideModule;
14 13
 use BEAR\Resource\Param;
15 14
 use BEAR\Resource\SignalParameter;
16 15
 use BEAR\Resource\ParamProviderInterface;
17
-use BEAR\Sunday\Module as SundayModule;
18 16
 use Ray\Di\InstanceInterface;
19 17
 use Ray\Di\ProviderInterface;
20 18
 use Ray\Di\Di\Inject;
Please login to merge, or discard this patch.
src/Provide/ResourceView/HalFactory.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 use Nocarrier\Hal;
12 12
 use BEAR\Resource\Link;
13 13
 use Ray\Di\Di\Inject;
14
-use Ray\Di\Di\Named;
15 14
 
16 15
 class HalFactory implements HalFactoryInterface
17 16
 {
Please login to merge, or discard this patch.
src/Provide/WebResponse/HttpFoundation.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
  */
7 7
 namespace BEAR\Package\Provide\WebResponse;
8 8
 
9
-use BEAR\Resource\ResourceObject as Page;
10 9
 use BEAR\Resource\ResourceObject;
11 10
 use BEAR\Resource\RenderInterface;
12 11
 use BEAR\Sunday\Exception\InvalidResourceType;
Please login to merge, or discard this patch.
var/www/admin/apc/apc.php 1 patch
Switch Indentation   +318 added lines, -318 removed lines patch added patch discarded remove patch
@@ -329,105 +329,105 @@  discard block
 block discarded – undo
329 329
 
330 330
 	switch ($MYREQUEST['IMG']) {
331 331
 
332
-	case 1:
333
-		$s=$mem['num_seg']*$mem['seg_size'];
334
-		$a=$mem['avail_mem'];
335
-		$x=$y=$size/2;
336
-		$fuzz = 0.000001;
337
-
338
-		// This block of code creates the pie chart.  It is a lot more complex than you
339
-		// would expect because we try to visualize any memory fragmentation as well.
340
-		$angle_from = 0;
341
-		$string_placement=array();
342
-		for($i=0; $i<$mem['num_seg']; $i++) {
343
-			$ptr = 0;
344
-			$free = $mem['block_lists'][$i];
345
-			uasort($free, 'block_sort');
346
-			foreach($free as $block) {
347
-				if($block['offset']!=$ptr) {       // Used block
348
-					$angle_to = $angle_from+($block['offset']-$ptr)/$s;
349
-					if(($angle_to+$fuzz)>1) $angle_to = 1;
350
-					if( ($angle_to*360) - ($angle_from*360) >= 1) {
351
-						fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_red);
352
-						if (($angle_to-$angle_from)>0.05) {
353
-							array_push($string_placement, array($angle_from,$angle_to));
354
-						}
355
-					}
356
-					$angle_from = $angle_to;
357
-				}
358
-				$angle_to = $angle_from+($block['size'])/$s;
359
-				if(($angle_to+$fuzz)>1) $angle_to = 1;
360
-				if( ($angle_to*360) - ($angle_from*360) >= 1) {
361
-					fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_green);
362
-					if (($angle_to-$angle_from)>0.05) {
363
-						array_push($string_placement, array($angle_from,$angle_to));
364
-					}
365
-				}
366
-				$angle_from = $angle_to;
367
-				$ptr = $block['offset']+$block['size'];
368
-			}
369
-			if ($ptr < $mem['seg_size']) { // memory at the end
370
-				$angle_to = $angle_from + ($mem['seg_size'] - $ptr)/$s;
371
-				if(($angle_to+$fuzz)>1) $angle_to = 1;
372
-				fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_red);
373
-				if (($angle_to-$angle_from)>0.05) {
374
-					array_push($string_placement, array($angle_from,$angle_to));
375
-				}
376
-			}
377
-		}
378
-		foreach ($string_placement as $angle) {
379
-			text_arc($image,$x,$y,$size,$angle[0]*360,$angle[1]*360,$col_black,bsize($s*($angle[1]-$angle[0])));
380
-		}
381
-		break;
382
-
383
-	case 2:
384
-		$s=$cache['nhits']+$cache['nmisses'];
385
-		$a=$cache['nhits'];
386
-
387
-		fill_box($image, 30,$size,50,$s ? (-$a*($size-21)/$s) : 0,$col_black,$col_green,sprintf("%.1f%%",$s ? $cache['nhits']*100/$s : 0));
388
-		fill_box($image,130,$size,50,$s ? -max(4,($s-$a)*($size-21)/$s) : 0,$col_black,$col_red,sprintf("%.1f%%",$s ? $cache['nmisses']*100/$s : 0));
389
-		break;
390
-
391
-	case 3:
392
-		$s=$mem['num_seg']*$mem['seg_size'];
393
-		$a=$mem['avail_mem'];
394
-		$x=130;
395
-		$y=1;
396
-		$j=1;
397
-
398
-		// This block of code creates the bar chart.  It is a lot more complex than you
399
-		// would expect because we try to visualize any memory fragmentation as well.
400
-		for($i=0; $i<$mem['num_seg']; $i++) {
401
-			$ptr = 0;
402
-			$free = $mem['block_lists'][$i];
403
-			uasort($free, 'block_sort');
404
-			foreach($free as $block) {
405
-				if($block['offset']!=$ptr) {       // Used block
406
-					$h=(GRAPH_SIZE-5)*($block['offset']-$ptr)/$s;
407
-					if ($h>0) {
408
-                                                $j++;
409
-						if($j<75) fill_box($image,$x,$y,50,$h,$col_black,$col_red,bsize($block['offset']-$ptr),$j);
410
-                                                else fill_box($image,$x,$y,50,$h,$col_black,$col_red);
411
-                                        }
412
-					$y+=$h;
413
-				}
414
-				$h=(GRAPH_SIZE-5)*($block['size'])/$s;
415
-				if ($h>0) {
416
-                                        $j++;
417
-					if($j<75) fill_box($image,$x,$y,50,$h,$col_black,$col_green,bsize($block['size']),$j);
418
-					else fill_box($image,$x,$y,50,$h,$col_black,$col_green);
419
-                                }
420
-				$y+=$h;
421
-				$ptr = $block['offset']+$block['size'];
422
-			}
423
-			if ($ptr < $mem['seg_size']) { // memory at the end
424
-				$h = (GRAPH_SIZE-5) * ($mem['seg_size'] - $ptr) / $s;
425
-				if ($h > 0) {
426
-					fill_box($image,$x,$y,50,$h,$col_black,$col_red,bsize($mem['seg_size']-$ptr),$j++);
427
-				}
428
-			}
429
-		}
430
-		break;
332
+	    case 1:
333
+		    $s=$mem['num_seg']*$mem['seg_size'];
334
+		    $a=$mem['avail_mem'];
335
+		    $x=$y=$size/2;
336
+		    $fuzz = 0.000001;
337
+
338
+		    // This block of code creates the pie chart.  It is a lot more complex than you
339
+		    // would expect because we try to visualize any memory fragmentation as well.
340
+		    $angle_from = 0;
341
+		    $string_placement=array();
342
+		    for($i=0; $i<$mem['num_seg']; $i++) {
343
+			    $ptr = 0;
344
+			    $free = $mem['block_lists'][$i];
345
+			    uasort($free, 'block_sort');
346
+			    foreach($free as $block) {
347
+				    if($block['offset']!=$ptr) {       // Used block
348
+					    $angle_to = $angle_from+($block['offset']-$ptr)/$s;
349
+					    if(($angle_to+$fuzz)>1) $angle_to = 1;
350
+					    if( ($angle_to*360) - ($angle_from*360) >= 1) {
351
+						    fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_red);
352
+						    if (($angle_to-$angle_from)>0.05) {
353
+							    array_push($string_placement, array($angle_from,$angle_to));
354
+						    }
355
+					    }
356
+					    $angle_from = $angle_to;
357
+				    }
358
+				    $angle_to = $angle_from+($block['size'])/$s;
359
+				    if(($angle_to+$fuzz)>1) $angle_to = 1;
360
+				    if( ($angle_to*360) - ($angle_from*360) >= 1) {
361
+					    fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_green);
362
+					    if (($angle_to-$angle_from)>0.05) {
363
+						    array_push($string_placement, array($angle_from,$angle_to));
364
+					    }
365
+				    }
366
+				    $angle_from = $angle_to;
367
+				    $ptr = $block['offset']+$block['size'];
368
+			    }
369
+			    if ($ptr < $mem['seg_size']) { // memory at the end
370
+				    $angle_to = $angle_from + ($mem['seg_size'] - $ptr)/$s;
371
+				    if(($angle_to+$fuzz)>1) $angle_to = 1;
372
+				    fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_red);
373
+				    if (($angle_to-$angle_from)>0.05) {
374
+					    array_push($string_placement, array($angle_from,$angle_to));
375
+				    }
376
+			    }
377
+		    }
378
+		    foreach ($string_placement as $angle) {
379
+			    text_arc($image,$x,$y,$size,$angle[0]*360,$angle[1]*360,$col_black,bsize($s*($angle[1]-$angle[0])));
380
+		    }
381
+		    break;
382
+
383
+	    case 2:
384
+		    $s=$cache['nhits']+$cache['nmisses'];
385
+		    $a=$cache['nhits'];
386
+
387
+		    fill_box($image, 30,$size,50,$s ? (-$a*($size-21)/$s) : 0,$col_black,$col_green,sprintf("%.1f%%",$s ? $cache['nhits']*100/$s : 0));
388
+		    fill_box($image,130,$size,50,$s ? -max(4,($s-$a)*($size-21)/$s) : 0,$col_black,$col_red,sprintf("%.1f%%",$s ? $cache['nmisses']*100/$s : 0));
389
+		    break;
390
+
391
+	    case 3:
392
+		    $s=$mem['num_seg']*$mem['seg_size'];
393
+		    $a=$mem['avail_mem'];
394
+		    $x=130;
395
+		    $y=1;
396
+		    $j=1;
397
+
398
+		    // This block of code creates the bar chart.  It is a lot more complex than you
399
+		    // would expect because we try to visualize any memory fragmentation as well.
400
+		    for($i=0; $i<$mem['num_seg']; $i++) {
401
+			    $ptr = 0;
402
+			    $free = $mem['block_lists'][$i];
403
+			    uasort($free, 'block_sort');
404
+			    foreach($free as $block) {
405
+				    if($block['offset']!=$ptr) {       // Used block
406
+					    $h=(GRAPH_SIZE-5)*($block['offset']-$ptr)/$s;
407
+					    if ($h>0) {
408
+                                                    $j++;
409
+						    if($j<75) fill_box($image,$x,$y,50,$h,$col_black,$col_red,bsize($block['offset']-$ptr),$j);
410
+                                                    else fill_box($image,$x,$y,50,$h,$col_black,$col_red);
411
+                                            }
412
+					    $y+=$h;
413
+				    }
414
+				    $h=(GRAPH_SIZE-5)*($block['size'])/$s;
415
+				    if ($h>0) {
416
+                                            $j++;
417
+					    if($j<75) fill_box($image,$x,$y,50,$h,$col_black,$col_green,bsize($block['size']),$j);
418
+					    else fill_box($image,$x,$y,50,$h,$col_black,$col_green);
419
+                                    }
420
+				    $y+=$h;
421
+				    $ptr = $block['offset']+$block['size'];
422
+			    }
423
+			    if ($ptr < $mem['seg_size']) { // memory at the end
424
+				    $h = (GRAPH_SIZE-5) * ($mem['seg_size'] - $ptr) / $s;
425
+				    if ($h > 0) {
426
+					    fill_box($image,$x,$y,50,$h,$col_black,$col_red,bsize($mem['seg_size']-$ptr),$j++);
427
+				    }
428
+			    }
429
+		    }
430
+		    break;
431 431
 
432 432
 		case 4:
433 433
 			$s=$cache['nhits']+$cache['nmisses'];
@@ -754,41 +754,41 @@  discard block
 block discarded – undo
754 754
 // -----------------------------------------------
755 755
 // Host Stats
756 756
 // -----------------------------------------------
757
-case OB_HOST_STATS:
758
-	$mem_size = $mem['num_seg']*$mem['seg_size'];
759
-	$mem_avail= $mem['avail_mem'];
760
-	$mem_used = $mem_size-$mem_avail;
761
-	$seg_size = bsize($mem['seg_size']);
762
-	$req_rate_user = sprintf("%.2f", $cache['nhits'] ? (($cache['nhits']+$cache['nmisses'])/($time-$cache['stime'])) : 0);
763
-	$hit_rate_user = sprintf("%.2f", $cache['nhits'] ? (($cache['nhits'])/($time-$cache['stime'])) : 0);
764
-	$miss_rate_user = sprintf("%.2f", $cache['nmisses'] ? (($cache['nmisses'])/($time-$cache['stime'])) : 0);
765
-	$insert_rate_user = sprintf("%.2f", $cache['ninserts'] ? (($cache['ninserts'])/($time-$cache['stime'])) : 0);
766
-	$apcversion = phpversion('apcu');
767
-	$phpversion = phpversion();
768
-	$number_vars = $cache['nentries'];
769
-    $size_vars = bsize($cache['mem_size']);
770
-	$i=0;
771
-	echo <<< EOB
757
+    case OB_HOST_STATS:
758
+	    $mem_size = $mem['num_seg']*$mem['seg_size'];
759
+	    $mem_avail= $mem['avail_mem'];
760
+	    $mem_used = $mem_size-$mem_avail;
761
+	    $seg_size = bsize($mem['seg_size']);
762
+	    $req_rate_user = sprintf("%.2f", $cache['nhits'] ? (($cache['nhits']+$cache['nmisses'])/($time-$cache['stime'])) : 0);
763
+	    $hit_rate_user = sprintf("%.2f", $cache['nhits'] ? (($cache['nhits'])/($time-$cache['stime'])) : 0);
764
+	    $miss_rate_user = sprintf("%.2f", $cache['nmisses'] ? (($cache['nmisses'])/($time-$cache['stime'])) : 0);
765
+	    $insert_rate_user = sprintf("%.2f", $cache['ninserts'] ? (($cache['ninserts'])/($time-$cache['stime'])) : 0);
766
+	    $apcversion = phpversion('apcu');
767
+	    $phpversion = phpversion();
768
+	    $number_vars = $cache['nentries'];
769
+        $size_vars = bsize($cache['mem_size']);
770
+	    $i=0;
771
+	    echo <<< EOB
772 772
 		<div class="info div1"><h2>General Cache Information</h2>
773 773
 		<table cellspacing=0><tbody>
774 774
 		<tr class=tr-0><td class=td-0>APCu Version</td><td>$apcversion</td></tr>
775 775
 		<tr class=tr-1><td class=td-0>PHP Version</td><td>$phpversion</td></tr>
776
-EOB;
776
+    EOB;
777 777
 
778
-	if(!empty($_SERVER['SERVER_NAME']))
779
-		echo "<tr class=tr-0><td class=td-0>APCu Host</td><td>{$_SERVER['SERVER_NAME']} $host</td></tr>\n";
780
-	if(!empty($_SERVER['SERVER_SOFTWARE']))
781
-		echo "<tr class=tr-1><td class=td-0>Server Software</td><td>{$_SERVER['SERVER_SOFTWARE']}</td></tr>\n";
778
+	    if(!empty($_SERVER['SERVER_NAME']))
779
+		    echo "<tr class=tr-0><td class=td-0>APCu Host</td><td>{$_SERVER['SERVER_NAME']} $host</td></tr>\n";
780
+	    if(!empty($_SERVER['SERVER_SOFTWARE']))
781
+		    echo "<tr class=tr-1><td class=td-0>Server Software</td><td>{$_SERVER['SERVER_SOFTWARE']}</td></tr>\n";
782 782
 
783
-	echo <<<EOB
784
-		<tr class=tr-0><td class=td-0>Shared Memory</td><td>{$mem['num_seg']} Segment(s) with $seg_size
783
+	    echo <<<EOB
784
+    		<tr class=tr-0><td class=td-0>Shared Memory</td><td>{$mem['num_seg']} Segment(s) with $seg_size
785 785
     <br/> ({$cache['memory_type']} memory)
786 786
     </td></tr>
787 787
 EOB;
788
-	echo   '<tr class=tr-1><td class=td-0>Start Time</td><td>',date(DATE_FORMAT,$cache['stime']),'</td></tr>';
789
-	echo   '<tr class=tr-0><td class=td-0>Uptime</td><td>',duration($cache['stime']),'</td></tr>';
790
-	echo   '<tr class=tr-1><td class=td-0>File Upload Support</td><td>',$cache['file_upload_progress'],'</td></tr>';
791
-	echo <<<EOB
788
+	    echo   '<tr class=tr-1><td class=td-0>Start Time</td><td>',date(DATE_FORMAT,$cache['stime']),'</td></tr>';
789
+	    echo   '<tr class=tr-0><td class=td-0>Uptime</td><td>',duration($cache['stime']),'</td></tr>';
790
+	    echo   '<tr class=tr-1><td class=td-0>File Upload Support</td><td>',$cache['file_upload_progress'],'</td></tr>';
791
+	    echo <<<EOB
792 792
 		</tbody></table>
793 793
 		</div>
794 794
 
@@ -810,46 +810,46 @@  discard block
 block discarded – undo
810 810
 		<div class="info div2"><h2>Runtime Settings</h2><table cellspacing=0><tbody>
811 811
 EOB;
812 812
 
813
-	$j = 0;
814
-	foreach (ini_get_all('apcu') as $k => $v) {
815
-		echo "<tr class=tr-$j><td class=td-0>",$k,"</td><td>",str_replace(',',',<br />',$v['local_value']),"</td></tr>\n";
816
-		$j = 1 - $j;
817
-	}
813
+	    $j = 0;
814
+	    foreach (ini_get_all('apcu') as $k => $v) {
815
+		    echo "<tr class=tr-$j><td class=td-0>",$k,"</td><td>",str_replace(',',',<br />',$v['local_value']),"</td></tr>\n";
816
+		    $j = 1 - $j;
817
+	    }
818 818
 
819
-	if($mem['num_seg']>1 || $mem['num_seg']==1 && count($mem['block_lists'][0])>1)
820
-		$mem_note = "Memory Usage<br /><font size=-2>(multiple slices indicate fragments)</font>";
821
-	else
822
-		$mem_note = "Memory Usage";
819
+	    if($mem['num_seg']>1 || $mem['num_seg']==1 && count($mem['block_lists'][0])>1)
820
+		    $mem_note = "Memory Usage<br /><font size=-2>(multiple slices indicate fragments)</font>";
821
+	    else
822
+		    $mem_note = "Memory Usage";
823 823
 
824
-	echo <<< EOB
824
+	    echo <<< EOB
825 825
 		</tbody></table>
826 826
 		</div>
827 827
 
828 828
 		<div class="graph div3"><h2>Host Status Diagrams</h2>
829 829
 		<table cellspacing=0><tbody>
830 830
 EOB;
831
-	$size='width='.(GRAPH_SIZE+50).' height='.(GRAPH_SIZE+10);
832
-echo <<<EOB
831
+	    $size='width='.(GRAPH_SIZE+50).' height='.(GRAPH_SIZE+10);
832
+    echo <<<EOB
833 833
 		<tr>
834 834
 		<td class=td-0>$mem_note</td>
835 835
 		<td class=td-1>Hits &amp; Misses</td>
836 836
 		</tr>
837 837
 EOB;
838 838
 
839
-	echo
840
-		graphics_avail() ?
841
-			  '<tr>'.
842
-			  "<td class=td-0><img alt=\"\" $size src=\"$PHP_SELF?IMG=1&$time\"></td>".
843
-			  "<td class=td-1><img alt=\"\" $size src=\"$PHP_SELF?IMG=2&$time\"></td></tr>\n"
844
-			: "",
845
-		'<tr>',
846
-		'<td class=td-0><span class="green box">&nbsp;</span>Free: ',bsize($mem_avail).sprintf(" (%.1f%%)",$mem_avail*100/$mem_size),"</td>\n",
847
-		'<td class=td-1><span class="green box">&nbsp;</span>Hits: ',$cache['nhits'].@sprintf(" (%.1f%%)",$cache['nhits']*100/($cache['nhits']+$cache['nmisses'])),"</td>\n",
848
-		'</tr>',
849
-		'<tr>',
850
-		'<td class=td-0><span class="red box">&nbsp;</span>Used: ',bsize($mem_used ).sprintf(" (%.1f%%)",$mem_used *100/$mem_size),"</td>\n",
851
-		'<td class=td-1><span class="red box">&nbsp;</span>Misses: ',$cache['nmisses'].@sprintf(" (%.1f%%)",$cache['nmisses']*100/($cache['nhits']+$cache['nmisses'])),"</td>\n";
852
-	echo <<< EOB
839
+	    echo
840
+		    graphics_avail() ?
841
+			      '<tr>'.
842
+			      "<td class=td-0><img alt=\"\" $size src=\"$PHP_SELF?IMG=1&$time\"></td>".
843
+			      "<td class=td-1><img alt=\"\" $size src=\"$PHP_SELF?IMG=2&$time\"></td></tr>\n"
844
+			    : "",
845
+		    '<tr>',
846
+		    '<td class=td-0><span class="green box">&nbsp;</span>Free: ',bsize($mem_avail).sprintf(" (%.1f%%)",$mem_avail*100/$mem_size),"</td>\n",
847
+		    '<td class=td-1><span class="green box">&nbsp;</span>Hits: ',$cache['nhits'].@sprintf(" (%.1f%%)",$cache['nhits']*100/($cache['nhits']+$cache['nmisses'])),"</td>\n",
848
+		    '</tr>',
849
+		    '<tr>',
850
+		    '<td class=td-0><span class="red box">&nbsp;</span>Used: ',bsize($mem_used ).sprintf(" (%.1f%%)",$mem_used *100/$mem_size),"</td>\n",
851
+		    '<td class=td-1><span class="red box">&nbsp;</span>Misses: ',$cache['nmisses'].@sprintf(" (%.1f%%)",$cache['nmisses']*100/($cache['nhits']+$cache['nmisses'])),"</td>\n";
852
+	    echo <<< EOB
853 853
 		</tr>
854 854
 		</tbody></table>
855 855
 
@@ -860,141 +860,141 @@  discard block
 block discarded – undo
860 860
 		<td class=td-0 colspan=2><br/>
861 861
 EOB;
862 862
 
863
-	// Fragementation: (freeseg - 1) / total_seg
864
-	$nseg = $freeseg = $fragsize = $freetotal = 0;
865
-	for($i=0; $i<$mem['num_seg']; $i++) {
866
-		$ptr = 0;
867
-		foreach($mem['block_lists'][$i] as $block) {
868
-			if ($block['offset'] != $ptr) {
869
-				++$nseg;
870
-			}
871
-			$ptr = $block['offset'] + $block['size'];
872
-                        /* Only consider blocks <5M for the fragmentation % */
873
-                        if($block['size']<(5*1024*1024)) $fragsize+=$block['size'];
874
-                        $freetotal+=$block['size'];
875
-		}
876
-		$freeseg += count($mem['block_lists'][$i]);
877
-	}
878
-
879
-	if ($freeseg > 1) {
880
-		$frag = sprintf("%.2f%% (%s out of %s in %d fragments)", ($fragsize/$freetotal)*100,bsize($fragsize),bsize($freetotal),$freeseg);
881
-	} else {
882
-		$frag = "0%";
883
-	}
884
-
885
-	if (graphics_avail()) {
886
-		$size='width='.(2*GRAPH_SIZE+150).' height='.(GRAPH_SIZE+10);
887
-		echo <<<EOB
888
-			<img alt="" $size src="$PHP_SELF?IMG=3&$time">
889
-EOB;
890
-	}
891
-	echo <<<EOB
892
-		</br>Fragmentation: $frag
863
+	    // Fragementation: (freeseg - 1) / total_seg
864
+	    $nseg = $freeseg = $fragsize = $freetotal = 0;
865
+	    for($i=0; $i<$mem['num_seg']; $i++) {
866
+		    $ptr = 0;
867
+		    foreach($mem['block_lists'][$i] as $block) {
868
+			    if ($block['offset'] != $ptr) {
869
+				    ++$nseg;
870
+			    }
871
+			    $ptr = $block['offset'] + $block['size'];
872
+                            /* Only consider blocks <5M for the fragmentation % */
873
+                            if($block['size']<(5*1024*1024)) $fragsize+=$block['size'];
874
+                            $freetotal+=$block['size'];
875
+		    }
876
+		    $freeseg += count($mem['block_lists'][$i]);
877
+	    }
878
+
879
+	    if ($freeseg > 1) {
880
+		    $frag = sprintf("%.2f%% (%s out of %s in %d fragments)", ($fragsize/$freetotal)*100,bsize($fragsize),bsize($freetotal),$freeseg);
881
+	    } else {
882
+		    $frag = "0%";
883
+	    }
884
+
885
+	    if (graphics_avail()) {
886
+		    $size='width='.(2*GRAPH_SIZE+150).' height='.(GRAPH_SIZE+10);
887
+		    echo <<<EOB
888
+    			<img alt="" $size src="$PHP_SELF?IMG=3&$time">
889
+    EOB;
890
+	    }
891
+	    echo <<<EOB
892
+    		</br>Fragmentation: $frag
893 893
 		</td>
894 894
 		</tr>
895 895
 EOB;
896
-        if(isset($mem['adist'])) {
897
-          foreach($mem['adist'] as $i=>$v) {
898
-            $cur = pow(2,$i); $nxt = pow(2,$i+1)-1;
899
-            if($i==0) $range = "1";
900
-            else $range = "$cur - $nxt";
901
-            echo "<tr><th align=right>$range</th><td align=right>$v</td></tr>\n";
902
-          }
903
-        }
904
-        echo <<<EOB
896
+            if(isset($mem['adist'])) {
897
+              foreach($mem['adist'] as $i=>$v) {
898
+                $cur = pow(2,$i); $nxt = pow(2,$i+1)-1;
899
+                if($i==0) $range = "1";
900
+                else $range = "$cur - $nxt";
901
+                echo "<tr><th align=right>$range</th><td align=right>$v</td></tr>\n";
902
+              }
903
+            }
904
+            echo <<<EOB
905 905
 		</tbody></table>
906 906
 		</div>
907 907
 EOB;
908 908
 
909
-	break;
910
-
911
-
912
-// -----------------------------------------------
913
-// User Cache Entries
914
-// -----------------------------------------------
915
-case OB_USER_CACHE:
916
-	if (!$AUTHENTICATED) {
917
-    echo '<div class="error">You need to login to see the user values here!<br/>&nbsp;<br/>';
918
-		put_login_link("Login now!");
919
-		echo '</div>';
920
-		break;
921
-	}
922
-	$fieldname='key';
923
-	$fieldheading='User Entry Label';
924
-	$fieldkey='key';
925
-
926
-	$cols=6;
927
-	echo <<<EOB
909
+	    break;
910
+
911
+
912
+    // -----------------------------------------------
913
+    // User Cache Entries
914
+    // -----------------------------------------------
915
+    case OB_USER_CACHE:
916
+	    if (!$AUTHENTICATED) {
917
+        echo '<div class="error">You need to login to see the user values here!<br/>&nbsp;<br/>';
918
+		    put_login_link("Login now!");
919
+		    echo '</div>';
920
+		    break;
921
+	    }
922
+	    $fieldname='key';
923
+	    $fieldheading='User Entry Label';
924
+	    $fieldkey='key';
925
+
926
+	    $cols=6;
927
+	    echo <<<EOB
928 928
 		<div class=sorting><form>Scope:
929 929
 		<input type=hidden name=OB value={$MYREQUEST['OB']}>
930 930
 		<select name=SCOPE>
931 931
 EOB;
932
-	echo
933
-		"<option value=A",$MYREQUEST['SCOPE']=='A' ? " selected":"",">Active</option>",
934
-		"<option value=D",$MYREQUEST['SCOPE']=='D' ? " selected":"",">Deleted</option>",
935
-		"</select>",
936
-		", Sorting:<select name=SORT1>",
937
-		"<option value=H",$MYREQUEST['SORT1']=='H' ? " selected":"",">Hits</option>",
938
-		"<option value=Z",$MYREQUEST['SORT1']=='Z' ? " selected":"",">Size</option>",
939
-		"<option value=S",$MYREQUEST['SORT1']=='S' ? " selected":"",">$fieldheading</option>",
940
-		"<option value=A",$MYREQUEST['SORT1']=='A' ? " selected":"",">Last accessed</option>",
941
-		"<option value=M",$MYREQUEST['SORT1']=='M' ? " selected":"",">Last modified</option>",
942
-		"<option value=C",$MYREQUEST['SORT1']=='C' ? " selected":"",">Created at</option>",
943
-		"<option value=D",$MYREQUEST['SORT1']=='D' ? " selected":"",">Deleted at</option>";
944
-	if($fieldname=='info') echo
945
-		"<option value=D",$MYREQUEST['SORT1']=='T' ? " selected":"",">Timeout</option>";
946
-	echo
947
-		'</select>',
948
-		'<select name=SORT2>',
949
-		'<option value=D',$MYREQUEST['SORT2']=='D' ? ' selected':'','>DESC</option>',
950
-		'<option value=A',$MYREQUEST['SORT2']=='A' ? ' selected':'','>ASC</option>',
951
-		'</select>',
952
-		'<select name=COUNT onChange="form.submit()">',
953
-		'<option value=10 ',$MYREQUEST['COUNT']=='10' ? ' selected':'','>Top 10</option>',
954
-		'<option value=20 ',$MYREQUEST['COUNT']=='20' ? ' selected':'','>Top 20</option>',
955
-		'<option value=50 ',$MYREQUEST['COUNT']=='50' ? ' selected':'','>Top 50</option>',
956
-		'<option value=100',$MYREQUEST['COUNT']=='100'? ' selected':'','>Top 100</option>',
957
-		'<option value=150',$MYREQUEST['COUNT']=='150'? ' selected':'','>Top 150</option>',
958
-		'<option value=200',$MYREQUEST['COUNT']=='200'? ' selected':'','>Top 200</option>',
959
-		'<option value=500',$MYREQUEST['COUNT']=='500'? ' selected':'','>Top 500</option>',
960
-		'<option value=0  ',$MYREQUEST['COUNT']=='0'  ? ' selected':'','>All</option>',
961
-		'</select>',
962
-    '&nbsp; Search: <input name=SEARCH value="',$MYREQUEST['SEARCH'],'" type=text size=25/>',
963
-		'&nbsp;<input type=submit value="GO!">',
964
-		'</form></div>';
965
-
966
-  if (isset($MYREQUEST['SEARCH'])) {
967
-   // Don't use preg_quote because we want the user to be able to specify a
968
-   // regular expression subpattern.
969
-   $MYREQUEST['SEARCH'] = '/'.str_replace('/', '\\/', $MYREQUEST['SEARCH']).'/i';
970
-   if (preg_match($MYREQUEST['SEARCH'], 'test') === false) {
971
-     echo '<div class="error">Error: enter a valid regular expression as a search query.</div>';
972
-     break;
973
-   }
974
-  }
975
-
976
-  echo
977
-		'<div class="info"><table cellspacing=0><tbody>',
978
-		'<tr>',
979
-		'<th>',sortheader('S',$fieldheading,  "&OB=".$MYREQUEST['OB']),'</th>',
980
-		'<th>',sortheader('H','Hits',         "&OB=".$MYREQUEST['OB']),'</th>',
981
-		'<th>',sortheader('Z','Size',         "&OB=".$MYREQUEST['OB']),'</th>',
982
-		'<th>',sortheader('A','Last accessed',"&OB=".$MYREQUEST['OB']),'</th>',
983
-		'<th>',sortheader('M','Last modified',"&OB=".$MYREQUEST['OB']),'</th>',
984
-		'<th>',sortheader('C','Created at',   "&OB=".$MYREQUEST['OB']),'</th>';
985
-
986
-	if($fieldname=='info') {
987
-		$cols+=2;
988
-		 echo '<th>',sortheader('T','Timeout',"&OB=".$MYREQUEST['OB']),'</th>';
989
-	}
990
-	echo '<th>',sortheader('D','Deleted at',"&OB=".$MYREQUEST['OB']),'</th></tr>';
991
-
992
-	// builds list with alpha numeric sortable keys
993
-	//
994
-	$list = array();
932
+	    echo
933
+		    "<option value=A",$MYREQUEST['SCOPE']=='A' ? " selected":"",">Active</option>",
934
+		    "<option value=D",$MYREQUEST['SCOPE']=='D' ? " selected":"",">Deleted</option>",
935
+		    "</select>",
936
+		    ", Sorting:<select name=SORT1>",
937
+		    "<option value=H",$MYREQUEST['SORT1']=='H' ? " selected":"",">Hits</option>",
938
+		    "<option value=Z",$MYREQUEST['SORT1']=='Z' ? " selected":"",">Size</option>",
939
+		    "<option value=S",$MYREQUEST['SORT1']=='S' ? " selected":"",">$fieldheading</option>",
940
+		    "<option value=A",$MYREQUEST['SORT1']=='A' ? " selected":"",">Last accessed</option>",
941
+		    "<option value=M",$MYREQUEST['SORT1']=='M' ? " selected":"",">Last modified</option>",
942
+		    "<option value=C",$MYREQUEST['SORT1']=='C' ? " selected":"",">Created at</option>",
943
+		    "<option value=D",$MYREQUEST['SORT1']=='D' ? " selected":"",">Deleted at</option>";
944
+	    if($fieldname=='info') echo
945
+		    "<option value=D",$MYREQUEST['SORT1']=='T' ? " selected":"",">Timeout</option>";
946
+	    echo
947
+		    '</select>',
948
+		    '<select name=SORT2>',
949
+		    '<option value=D',$MYREQUEST['SORT2']=='D' ? ' selected':'','>DESC</option>',
950
+		    '<option value=A',$MYREQUEST['SORT2']=='A' ? ' selected':'','>ASC</option>',
951
+		    '</select>',
952
+		    '<select name=COUNT onChange="form.submit()">',
953
+		    '<option value=10 ',$MYREQUEST['COUNT']=='10' ? ' selected':'','>Top 10</option>',
954
+		    '<option value=20 ',$MYREQUEST['COUNT']=='20' ? ' selected':'','>Top 20</option>',
955
+		    '<option value=50 ',$MYREQUEST['COUNT']=='50' ? ' selected':'','>Top 50</option>',
956
+		    '<option value=100',$MYREQUEST['COUNT']=='100'? ' selected':'','>Top 100</option>',
957
+		    '<option value=150',$MYREQUEST['COUNT']=='150'? ' selected':'','>Top 150</option>',
958
+		    '<option value=200',$MYREQUEST['COUNT']=='200'? ' selected':'','>Top 200</option>',
959
+		    '<option value=500',$MYREQUEST['COUNT']=='500'? ' selected':'','>Top 500</option>',
960
+		    '<option value=0  ',$MYREQUEST['COUNT']=='0'  ? ' selected':'','>All</option>',
961
+		    '</select>',
962
+        '&nbsp; Search: <input name=SEARCH value="',$MYREQUEST['SEARCH'],'" type=text size=25/>',
963
+		    '&nbsp;<input type=submit value="GO!">',
964
+		    '</form></div>';
965
+
966
+      if (isset($MYREQUEST['SEARCH'])) {
967
+       // Don't use preg_quote because we want the user to be able to specify a
968
+       // regular expression subpattern.
969
+       $MYREQUEST['SEARCH'] = '/'.str_replace('/', '\\/', $MYREQUEST['SEARCH']).'/i';
970
+       if (preg_match($MYREQUEST['SEARCH'], 'test') === false) {
971
+         echo '<div class="error">Error: enter a valid regular expression as a search query.</div>';
972
+         break;
973
+       }
974
+      }
995 975
 
996
-	foreach($cache[$scope_list[$MYREQUEST['SCOPE']]] as $i => $entry) {
997
-		switch($MYREQUEST['SORT1']) {
976
+      echo
977
+		    '<div class="info"><table cellspacing=0><tbody>',
978
+		    '<tr>',
979
+		    '<th>',sortheader('S',$fieldheading,  "&OB=".$MYREQUEST['OB']),'</th>',
980
+		    '<th>',sortheader('H','Hits',         "&OB=".$MYREQUEST['OB']),'</th>',
981
+		    '<th>',sortheader('Z','Size',         "&OB=".$MYREQUEST['OB']),'</th>',
982
+		    '<th>',sortheader('A','Last accessed',"&OB=".$MYREQUEST['OB']),'</th>',
983
+		    '<th>',sortheader('M','Last modified',"&OB=".$MYREQUEST['OB']),'</th>',
984
+		    '<th>',sortheader('C','Created at',   "&OB=".$MYREQUEST['OB']),'</th>';
985
+
986
+	    if($fieldname=='info') {
987
+		    $cols+=2;
988
+		     echo '<th>',sortheader('T','Timeout',"&OB=".$MYREQUEST['OB']),'</th>';
989
+	    }
990
+	    echo '<th>',sortheader('D','Deleted at',"&OB=".$MYREQUEST['OB']),'</th></tr>';
991
+
992
+	    // builds list with alpha numeric sortable keys
993
+	    //
994
+	    $list = array();
995
+
996
+	    foreach($cache[$scope_list[$MYREQUEST['SCOPE']]] as $i => $entry) {
997
+		    switch($MYREQUEST['SORT1']) {
998 998
 			case 'A': $k=sprintf('%015d-',$entry['atime']);  	    break;
999 999
 			case 'H': $k=sprintf('%015d-',$entry['nhits']); 		break;
1000 1000
 			case 'Z': $k=sprintf('%015d-',$entry['mem_size']); 		break;
@@ -1003,7 +1003,7 @@  discard block
 block discarded – undo
1003 1003
 			case 'T': $k=sprintf('%015d-',$entry['ttl']);			break;
1004 1004
 			case 'D': $k=sprintf('%015d-',$entry['dtime']);      	break;
1005 1005
 			case 'S': $k=$entry["key"];								break;
1006
-		}
1006
+		    }
1007 1007
 		if (!$AUTHENTICATED) {
1008 1008
 			// hide all path entries if not logged in
1009 1009
 			$list[$k.$entry[$fieldname]]=preg_replace('/^.*(\\/|\\\\)/','*hidden*/',$entry);
@@ -1083,61 +1083,61 @@  discard block
 block discarded – undo
1083 1083
 // -----------------------------------------------
1084 1084
 // Version check
1085 1085
 // -----------------------------------------------
1086
-case OB_VERSION_CHECK:
1087
-	echo <<<EOB
1086
+    case OB_VERSION_CHECK:
1087
+	    echo <<<EOB
1088 1088
 		<div class="info"><h2>APCu Version Information</h2>
1089 1089
 		<table cellspacing=0><tbody>
1090 1090
 		<tr>
1091 1091
 		<th></th>
1092 1092
 		</tr>
1093 1093
 EOB;
1094
-  if (defined('PROXY')) {
1095
-    $ctxt = stream_context_create( array( 'http' => array( 'proxy' => PROXY, 'request_fulluri' => True ) ) );
1096
-    $rss = @file_get_contents("http://pecl.php.net/feeds/pkg_apcu.rss", False, $ctxt);
1097
-  } else {
1098
-    $rss = @file_get_contents("http://pecl.php.net/feeds/pkg_apcu.rss");
1099
-  }
1100
-	if (!$rss) {
1101
-		echo '<tr class="td-last center"><td>Unable to fetch version information.</td></tr>';
1102
-	} else {
1103
-		$apcversion = phpversion('apc');
1104
-
1105
-		preg_match('!<title>APCu ([0-9.]+)</title>!', $rss, $match);
1106
-		echo '<tr class="tr-0 center"><td>';
1107
-		if (version_compare($apcversion, $match[1], '>=')) {
1108
-			echo '<div class="ok">You are running the latest version of APCu ('.$apcversion.')</div>';
1109
-			$i = 3;
1110
-		} else {
1111
-			echo '<div class="failed">You are running an older version of APCu ('.$apcversion.'),
1094
+      if (defined('PROXY')) {
1095
+        $ctxt = stream_context_create( array( 'http' => array( 'proxy' => PROXY, 'request_fulluri' => True ) ) );
1096
+        $rss = @file_get_contents("http://pecl.php.net/feeds/pkg_apcu.rss", False, $ctxt);
1097
+      } else {
1098
+        $rss = @file_get_contents("http://pecl.php.net/feeds/pkg_apcu.rss");
1099
+      }
1100
+	    if (!$rss) {
1101
+		    echo '<tr class="td-last center"><td>Unable to fetch version information.</td></tr>';
1102
+	    } else {
1103
+		    $apcversion = phpversion('apc');
1104
+
1105
+		    preg_match('!<title>APCu ([0-9.]+)</title>!', $rss, $match);
1106
+		    echo '<tr class="tr-0 center"><td>';
1107
+		    if (version_compare($apcversion, $match[1], '>=')) {
1108
+			    echo '<div class="ok">You are running the latest version of APCu ('.$apcversion.')</div>';
1109
+			    $i = 3;
1110
+		    } else {
1111
+			    echo '<div class="failed">You are running an older version of APCu ('.$apcversion.'),
1112 1112
 				newer version '.$match[1].' is available at <a href="http://pecl.php.net/package/APCu/'.$match[1].'">
1113 1113
 				http://pecl.php.net/package/APCu/'.$match[1].'</a>
1114 1114
 				</div>';
1115
-			$i = -1;
1116
-		}
1117
-		echo '</td></tr>';
1118
-		echo '<tr class="tr-0"><td><h3>Change Log:</h3><br/>';
1119
-
1120
-		preg_match_all('!<(title|description)>([^<]+)</\\1>!', $rss, $match);
1121
-		next($match[2]); next($match[2]);
1122
-
1123
-		while (list(,$v) = each($match[2])) {
1124
-			list(,$ver) = explode(' ', $v, 2);
1125
-			if ($i < 0 && version_compare($apcversion, $ver, '>=')) {
1126
-				break;
1127
-			} else if (!$i--) {
1128
-				break;
1129
-			}
1130
-			echo "<b><a href=\"http://pecl.php.net/package/APCu/$ver\">".htmlspecialchars($v, ENT_QUOTES, 'UTF-8')."</a></b><br><blockquote>";
1131
-			echo nl2br(htmlspecialchars(current($match[2]), ENT_QUOTES, 'UTF-8'))."</blockquote>";
1132
-			next($match[2]);
1133
-		}
1134
-		echo '</td></tr>';
1135
-	}
1136
-	echo <<< EOB
1115
+			    $i = -1;
1116
+		    }
1117
+		    echo '</td></tr>';
1118
+		    echo '<tr class="tr-0"><td><h3>Change Log:</h3><br/>';
1119
+
1120
+		    preg_match_all('!<(title|description)>([^<]+)</\\1>!', $rss, $match);
1121
+		    next($match[2]); next($match[2]);
1122
+
1123
+		    while (list(,$v) = each($match[2])) {
1124
+			    list(,$ver) = explode(' ', $v, 2);
1125
+			    if ($i < 0 && version_compare($apcversion, $ver, '>=')) {
1126
+				    break;
1127
+			    } else if (!$i--) {
1128
+				    break;
1129
+			    }
1130
+			    echo "<b><a href=\"http://pecl.php.net/package/APCu/$ver\">".htmlspecialchars($v, ENT_QUOTES, 'UTF-8')."</a></b><br><blockquote>";
1131
+			    echo nl2br(htmlspecialchars(current($match[2]), ENT_QUOTES, 'UTF-8'))."</blockquote>";
1132
+			    next($match[2]);
1133
+		    }
1134
+		    echo '</td></tr>';
1135
+	    }
1136
+	    echo <<< EOB
1137 1137
 		</tbody></table>
1138 1138
 		</div>
1139 1139
 EOB;
1140
-	break;
1140
+	    break;
1141 1141
 
1142 1142
 }
1143 1143
 
Please login to merge, or discard this patch.