Browse Source

adds tests to slim-hhvm and slim-php5

Keith Newman 9 years ago
parent
commit
1bc40d911b

+ 5 - 0
frameworks/PHP/slim/benchmark_config.json

@@ -26,9 +26,11 @@
     },
     "hhvm": {
       "setup_file": "setup_hhvm",
+      "plaintext_url": "/plaintext",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/dbs?queries=",
+      "update_url": "/updates?queries=",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Micro",
@@ -46,9 +48,12 @@
     },
     "php5": {
       "setup_file": "setup_php5",
+      "plaintext_url": "/plaintext",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/dbs?queries=",
+      "update_url": "/updates?queries=",
+      "fortune_url": "/fortunes",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Micro",

+ 1 - 1
frameworks/PHP/slim/index.php

@@ -101,7 +101,7 @@ $app->get('/fortunes', function ($request, $response) {
     usort($fortunes, function($left, $right) {
         return strcmp($left['message'], $right['message']);
     });
-    return $this->view->render($response, "fortunes.phtml", ["fortunes" => $fortunes]);
+    return $this->view->render($response, "fortunes.php", ["fortunes" => $fortunes]);
 });
 
 $app->run();

+ 1 - 1
frameworks/PHP/slim/templates/fortunes.phtml → frameworks/PHP/slim/templates/fortunes.php

@@ -10,7 +10,7 @@
         <?php foreach($data['fortunes'] as $fortune){ ?>
             <tr>
                 <td><?php echo $fortune['id']; ?></td>
-                <td><?php echo filter_var($fortune['message'], FILTER_SANITIZE_SPECIAL_CHARS); ?></td>
+                <td><?php echo htmlspecialchars($fortune['message']); ?></td>
             </tr>
         <?php } ?>
     </table>