@@ -9,8 +9,6 @@ |
||
| 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 | |
@@ -13,7 +13,6 @@ |
||
| 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; |
@@ -9,7 +9,6 @@ |
||
| 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 | |
@@ -10,7 +10,6 @@ |
||
| 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 | |
@@ -6,10 +6,7 @@ |
||
| 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 | { |
@@ -10,11 +10,9 @@ |
||
| 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; |
@@ -11,7 +11,6 @@ |
||
| 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 | { |
@@ -6,7 +6,6 @@ |
||
| 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; |
@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | $values = explode(':', $server); |
| 52 | 52 | if (($values[0] == 'unix') && (!is_numeric( $values[1]))) { |
| 53 | 53 | return array($server, 0); |
| 54 | - } |
|
| 55 | - else { |
|
| 54 | + } else { |
|
| 56 | 55 | return $values; |
| 57 | 56 | } |
| 58 | 57 | } |
@@ -110,7 +109,7 @@ discard block |
||
| 110 | 109 | $res[$l[0]][$l[1]]['stat']=array('flag'=>$flag,'size'=>$size); |
| 111 | 110 | $res[$l[0]][$l[1]]['value']=$lines[++$i]; |
| 112 | 111 | } |
| 113 | - }elseif($line=='DELETED' || $line=='NOT_FOUND' || $line=='OK'){ |
|
| 112 | + } elseif($line=='DELETED' || $line=='NOT_FOUND' || $line=='OK'){ |
|
| 114 | 113 | return $line; |
| 115 | 114 | } |
| 116 | 115 | } |
@@ -257,16 +256,35 @@ discard block |
||
| 257 | 256 | $hours = (int)(($rem)/3600) - $days*24 - $weeks*7*24; |
| 258 | 257 | $mins = (int)(($rem)/60) - $hours*60 - $days*24*60 - $weeks*7*24*60; |
| 259 | 258 | $str = ''; |
| 260 | - if($years==1) $str .= "$years year, "; |
|
| 261 | - if($years>1) $str .= "$years years, "; |
|
| 262 | - if($weeks==1) $str .= "$weeks week, "; |
|
| 263 | - if($weeks>1) $str .= "$weeks weeks, "; |
|
| 264 | - if($days==1) $str .= "$days day,"; |
|
| 265 | - if($days>1) $str .= "$days days,"; |
|
| 266 | - if($hours == 1) $str .= " $hours hour and"; |
|
| 267 | - if($hours>1) $str .= " $hours hours and"; |
|
| 268 | - if($mins == 1) $str .= " 1 minute"; |
|
| 269 | - else $str .= " $mins minutes"; |
|
| 259 | + if($years==1) { |
|
| 260 | + $str .= "$years year, "; |
|
| 261 | + } |
|
| 262 | + if($years>1) { |
|
| 263 | + $str .= "$years years, "; |
|
| 264 | + } |
|
| 265 | + if($weeks==1) { |
|
| 266 | + $str .= "$weeks week, "; |
|
| 267 | + } |
|
| 268 | + if($weeks>1) { |
|
| 269 | + $str .= "$weeks weeks, "; |
|
| 270 | + } |
|
| 271 | + if($days==1) { |
|
| 272 | + $str .= "$days day,"; |
|
| 273 | + } |
|
| 274 | + if($days>1) { |
|
| 275 | + $str .= "$days days,"; |
|
| 276 | + } |
|
| 277 | + if($hours == 1) { |
|
| 278 | + $str .= " $hours hour and"; |
|
| 279 | + } |
|
| 280 | + if($hours>1) { |
|
| 281 | + $str .= " $hours hours and"; |
|
| 282 | + } |
|
| 283 | + if($mins == 1) { |
|
| 284 | + $str .= " 1 minute"; |
|
| 285 | + } else { |
|
| 286 | + $str .= " $mins minutes"; |
|
| 287 | + } |
|
| 270 | 288 | return $str; |
| 271 | 289 | } |
| 272 | 290 | |
@@ -278,7 +296,9 @@ discard block |
||
| 278 | 296 | |
| 279 | 297 | function bsize($s) { |
| 280 | 298 | foreach (array('','K','M','G') as $i => $k) { |
| 281 | - if ($s < 1024) break; |
|
| 299 | + if ($s < 1024) { |
|
| 300 | + break; |
|
| 301 | + } |
|
| 282 | 302 | $s/=1024; |
| 283 | 303 | } |
| 284 | 304 | return sprintf("%5.1f %sBytes",$s,$k); |
@@ -506,8 +526,7 @@ discard block |
||
| 506 | 526 | echo <<<EOB |
| 507 | 527 | <li><a href="$PHP_SELF&op={$_GET['op']}">Refresh Data</a></li> |
| 508 | 528 | EOB; |
| 509 | -} |
|
| 510 | -else { |
|
| 529 | +} else { |
|
| 511 | 530 | echo <<<EOB |
| 512 | 531 | <li><a href="$PHP_SELF&op=2}">Back</a></li> |
| 513 | 532 | EOB; |
@@ -557,8 +576,11 @@ discard block |
||
| 557 | 576 | $y1=$y+$h-1; |
| 558 | 577 | |
| 559 | 578 | imagerectangle($im, $x, $y1, $x1+1, $y+1, $col_black); |
| 560 | - if($y1>$y) imagefilledrectangle($im, $x, $y, $x1, $y1, $color2); |
|
| 561 | - else imagefilledrectangle($im, $x, $y1, $x1, $y, $color2); |
|
| 579 | + if($y1>$y) { |
|
| 580 | + imagefilledrectangle($im, $x, $y, $x1, $y1, $color2); |
|
| 581 | + } else { |
|
| 582 | + imagefilledrectangle($im, $x, $y1, $x1, $y, $color2); |
|
| 583 | + } |
|
| 562 | 584 | imagerectangle($im, $x, $y1, $x1, $y, $color1); |
| 563 | 585 | if ($text) { |
| 564 | 586 | if ($placeindex>0) { |
@@ -713,8 +735,7 @@ discard block |
||
| 713 | 735 | foreach($MEMCACHE_SERVERS as $server){ |
| 714 | 736 | echo ($i+1).'. <a href="'.$PHP_SELF.'&singleout='.$i++.'">'.$server.'</a><br/>'; |
| 715 | 737 | } |
| 716 | - } |
|
| 717 | - else{ |
|
| 738 | + } else{ |
|
| 718 | 739 | echo '1.'.$MEMCACHE_SERVERS[0]; |
| 719 | 740 | } |
| 720 | 741 | if (isset($_GET['singleout'])){ |
@@ -821,8 +842,7 @@ discard block |
||
| 821 | 842 | echo '<a href="',$PHP_SELF,'&op=4&server=',(array_search($server,$MEMCACHE_SERVERS)),'&key=',base64_encode($itemKey).'">',$itemKey,'</a>'; |
| 822 | 843 | if ($i++ % 10 == 0) { |
| 823 | 844 | echo '<br/>'; |
| 824 | - } |
|
| 825 | - elseif ($i!=$slab['number']+1){ |
|
| 845 | + } elseif ($i!=$slab['number']+1){ |
|
| 826 | 846 | echo ','; |
| 827 | 847 | } |
| 828 | 848 | } |
@@ -861,8 +881,7 @@ discard block |
||
| 861 | 881 | echo "<tr><td class=td-0>",$theserver,"</td><td class=td-0>",$theKey, |
| 862 | 882 | "</td><td>[The requested item was not found or has expired]</td>", |
| 863 | 883 | "<td></td>","</tr>"; |
| 864 | - } |
|
| 865 | - else { |
|
| 884 | + } else { |
|
| 866 | 885 | |
| 867 | 886 | echo "<tr><td class=td-0>",$theserver,"</td><td class=td-0>",$theKey, |
| 868 | 887 | " <br/>flag:",$r['VALUE'][$theKey]['stat']['flag'], |