Browse Source

Sync with latest framework benchmark setup script changes

Marco Pivetta 11 years ago
parent
commit
eca3849805

+ 14 - 2
php-zend-framework/benchmark_config

@@ -1,5 +1,5 @@
 {
 {
-  "framework": "zend-framework",
+  "framework": "ZendFramework",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
       "setup_file": "setup",
       "setup_file": "setup",
@@ -7,7 +7,19 @@
       "db_url": "/db",
       "db_url": "/db",
       "query_url": "/db-multi?queries=",
       "query_url": "/db-multi?queries=",
       "port": 8080,
       "port": 8080,
-      "sort": 51
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "MySQL",
+      "framework": "ZendFramework",
+      "language": "PHP",
+      "orm": "Full",
+      "platform": "PHP-FPM",
+      "webserver": "nginx",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "ZendFramework",
+      "notes": "",
+      "versus": "php"
     }
     }
   }]
   }]
 }
 }

+ 1 - 1
php-zend-framework/composer.json

@@ -9,7 +9,7 @@
     "homepage": "http://framework.zend.com/",
     "homepage": "http://framework.zend.com/",
     "require": {
     "require": {
         "php": ">=5.3.3",
         "php": ">=5.3.3",
-        "zendframework/zendframework": ">2.1.3"
+        "zendframework/zendframework": "~2.2"
     },
     },
     "autoload": {
     "autoload": {
         "psr-0": {
         "psr-0": {

+ 9 - 10
php-zend-framework/setup.py

@@ -1,4 +1,3 @@
-
 import subprocess
 import subprocess
 import sys
 import sys
 import setup_util
 import setup_util
@@ -6,23 +5,23 @@ from os.path import expanduser
 
 
 home = expanduser("~")
 home = expanduser("~")
 
 
-def start(args):
+def start(args, logfile, errfile):
   setup_util.replace_text("php-zend-framework/config/benchmarks.local.php", "mysql:dbname=hello_world;host=localhost", "mysql:dbname=hello_world;host=" + args.database_host)
   setup_util.replace_text("php-zend-framework/config/benchmarks.local.php", "mysql:dbname=hello_world;host=localhost", "mysql:dbname=hello_world;host=" + args.database_host)
   setup_util.replace_text("php-zend-framework/deploy/nginx.conf", "root .*\/FrameworkBenchmarks", "root " + home + "/FrameworkBenchmarks")
   setup_util.replace_text("php-zend-framework/deploy/nginx.conf", "root .*\/FrameworkBenchmarks", "root " + home + "/FrameworkBenchmarks")
 
 
   try:
   try:
-    subprocess.check_call("composer.phar install --optimize-autoloader", shell=True, cwd="php-zend-framework")
-    subprocess.check_call("sudo chown -R www-data:www-data php-zend-framework", shell=True)
-    subprocess.check_call("sudo php-fpm --fpm-config config/php-fpm.conf -g " + home + "/FrameworkBenchmarks/php-zend-framework/deploy/php-fpm.pid", shell=True)
-    subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/php-zend-framework/deploy/nginx.conf", shell=True)
+    subprocess.check_call("composer.phar install --optimize-autoloader", shell=True, cwd="php-zend-framework", stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo chown -R www-data:www-data php-zend-framework", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo php-fpm --fpm-config config/php-fpm.conf -g " + home + "/FrameworkBenchmarks/php-zend-framework/deploy/php-fpm.pid", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/php-zend-framework/deploy/nginx.conf", shell=True, stderr=errfile, stdout=logfile)
     return 0
     return 0
   except subprocess.CalledProcessError:
   except subprocess.CalledProcessError:
     return 1
     return 1
-def stop():
+def stop(logfile, errfile):
   try:
   try:
-    subprocess.call("sudo /usr/local/nginx/sbin/nginx -s stop", shell=True)
-    subprocess.call("sudo kill -QUIT $( cat php-zend-framework/deploy/php-fpm.pid )", shell=True)
-    subprocess.check_call("sudo chown -R $USER:$USER php-zend-framework", shell=True)
+    subprocess.call("sudo /usr/local/nginx/sbin/nginx -s stop", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.call("sudo kill -QUIT $( cat php-zend-framework/deploy/php-fpm.pid )", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo chown -R $USER:$USER php-zend-framework", shell=True, stderr=errfile, stdout=logfile)
     return 0
     return 0
   except subprocess.CalledProcessError:
   except subprocess.CalledProcessError:
     return 1
     return 1