浏览代码

Queries number set between 1 and 500

Same commit as for symfony2 not stripped.
Arnaud Kleinpeter 11 年之前
父节点
当前提交
9d8273f841
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      php-symfony2-stripped/src/Skamander/BenchmarkBundle/Controller/BenchController.php

+ 2 - 0
php-symfony2-stripped/src/Skamander/BenchmarkBundle/Controller/BenchController.php

@@ -19,6 +19,8 @@ class BenchController extends Controller
     public function dbAction(Request $request)
     {
         $queries = $request->query->getInt('queries', 1);
+        $queries = max(1, $queries);
+        $queries = min(500, $queries);
 
         // possibility for enhancement is the use of SplFixedArray -> http://php.net/manual/de/class.splfixedarray.php
         $worlds = array();