Browse Source

Added php5 tests to php framework to compare with php7
Updated .gitignore

Nate Brady 9 years ago
parent
commit
0d45c7ac61

+ 8 - 1
frameworks/PHP/php/.gitignore

@@ -1,2 +1,9 @@
-deploy/php-fpm.pid
+# These files are touched during framework tests, but may need to be edited at times. Make sure to force add the files you edit.
+
+dborm.php
+dbraw.php
+fortune.php
+updateraw.php
+deploy/
 vendor/
+

+ 3 - 0
frameworks/PHP/php/README.md

@@ -2,6 +2,9 @@
 
 This is the PHP portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
 
+### Important
+When editing this framework, be sure to force add the files changed. Most files were added to .gitignore, as the framework touches some of them during testing.
+
 ### JSON Encoding Test
 Use the PHP standard [JSON encoder](http://www.php.net/manual/en/function.json-encode.php)
 

+ 42 - 0
frameworks/PHP/php/benchmark_config.json

@@ -42,6 +42,48 @@
       "display_name": "php",
       "notes": "",
       "versus": "php"
+    },
+    "php5": {
+      "setup_file": "setup_php5",
+      "json_url": "/json.php",
+      "plaintext_url": "/plaintext.php",
+      "db_url": "/dborm.php",
+      "query_url": "/dborm.php?queries=",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "MySQL",
+      "framework": "php",
+      "language": "PHP5",
+      "orm": "Full",
+      "platform": "PHP-FPM",
+      "webserver": "nginx",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "php5",
+      "notes": "",
+      "versus": "php"
+    },
+    "php5-raw": {
+      "setup_file": "setup",
+      "db_url": "/dbraw.php",
+      "query_url": "/dbraw.php?queries=",
+      "fortune_url": "/fortune.php",
+      "update_url": "/updateraw.php?queries=",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "MySQL",
+      "framework": "php",
+      "language": "PHP5",
+      "orm": "Raw",
+      "platform": "PHP-FPM",
+      "webserver": "nginx",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "php5-raw",
+      "notes": "",
+      "versus": "php"
     }
   }]
 }

+ 16 - 0
frameworks/PHP/php/setup_php5.sh

@@ -0,0 +1,16 @@
+#!/bin/bash
+
+fw_depends php nginx composer
+
+sed -i "s|localhost|${DBHOST}|g" dborm.php
+sed -i "s|localhost|${DBHOST}|g" dbraw.php
+sed -i "s|localhost|${DBHOST}|g" updateraw.php
+sed -i "s|localhost|${DBHOST}|g" fortune.php
+
+sed -i "s|TEST_ROOT|${TROOT}|g" deploy/php
+sed -i "s|TEST_ROOT|${TROOT}|g" deploy/nginx.conf
+
+sed -i "s|/usr/local/nginx/|${IROOT}/nginx/|g" deploy/nginx.conf
+
+php-fpm --fpm-config $FWROOT/config/php-fpm.conf -g $TROOT/deploy/php-fpm.pid
+nginx -c $TROOT/deploy/nginx.conf