Explorar el Código

Update and reconfigure PHP stack (#3291)

Joan Miquel hace 7 años
padre
commit
6674dd637c
Se han modificado 68 ficheros con 915 adiciones y 141 borrados
  1. 1 0
      .travis.yml
  2. 1 1
      frameworks/PHP/README.md
  3. 3 2
      frameworks/PHP/cakephp/deploy/nginx.conf
  4. 3 2
      frameworks/PHP/clancats/deploy/nginx.conf
  5. 3 2
      frameworks/PHP/codeigniter/deploy/nginx.conf
  6. 3 2
      frameworks/PHP/cygnite/deploy/nginx.conf
  7. 3 2
      frameworks/PHP/fat-free/deploy/nginx.conf
  8. 3 2
      frameworks/PHP/fuel/deploy/nginx.conf
  9. 3 2
      frameworks/PHP/hhvm/deploy/nginx.conf
  10. 3 2
      frameworks/PHP/kohana/deploy/nginx.conf
  11. 2 0
      frameworks/PHP/kumbiaphp/.gitignore
  12. 42 0
      frameworks/PHP/kumbiaphp/README.md
  13. 38 0
      frameworks/PHP/kumbiaphp/bench/app/config/config.ini
  14. 16 0
      frameworks/PHP/kumbiaphp/bench/app/config/config.php
  15. 11 0
      frameworks/PHP/kumbiaphp/bench/app/config/databases.php
  16. 38 0
      frameworks/PHP/kumbiaphp/bench/app/controllers/db_controller.php
  17. 13 0
      frameworks/PHP/kumbiaphp/bench/app/controllers/fortune_controller.php
  18. 16 0
      frameworks/PHP/kumbiaphp/bench/app/controllers/index_controller.php
  19. 12 0
      frameworks/PHP/kumbiaphp/bench/app/controllers/json_controller.php
  20. 59 0
      frameworks/PHP/kumbiaphp/bench/app/controllers/raw_controller.php
  21. 20 0
      frameworks/PHP/kumbiaphp/bench/app/controllers/raw_fortune_controller.php
  22. 33 0
      frameworks/PHP/kumbiaphp/bench/app/libs/admin_controller.php
  23. 30 0
      frameworks/PHP/kumbiaphp/bench/app/libs/app_controller.php
  24. 32 0
      frameworks/PHP/kumbiaphp/bench/app/libs/rest_controller.php
  25. 87 0
      frameworks/PHP/kumbiaphp/bench/app/libs/scaffold_controller.php
  26. 16 0
      frameworks/PHP/kumbiaphp/bench/app/libs/view.php
  27. 9 0
      frameworks/PHP/kumbiaphp/bench/app/models/fortune.php
  28. 9 0
      frameworks/PHP/kumbiaphp/bench/app/models/world.php
  29. 24 0
      frameworks/PHP/kumbiaphp/bench/app/views/_shared/templates/default.phtml
  30. 4 0
      frameworks/PHP/kumbiaphp/bench/app/views/_shared/templates/fortune.phtml
  31. 2 0
      frameworks/PHP/kumbiaphp/bench/app/views/_shared/templates/hello.phtml
  32. 4 0
      frameworks/PHP/kumbiaphp/bench/app/views/_shared/templates/json.phtml
  33. 4 0
      frameworks/PHP/kumbiaphp/bench/app/views/_shared/templates/raw.phtml
  34. 34 0
      frameworks/PHP/kumbiaphp/bench/public/.user.ini
  35. BIN
      frameworks/PHP/kumbiaphp/bench/public/favicon.ico
  36. 97 0
      frameworks/PHP/kumbiaphp/bench/public/index.php
  37. 51 0
      frameworks/PHP/kumbiaphp/benchmark_config.json
  38. 65 0
      frameworks/PHP/kumbiaphp/deploy/nginx.conf
  39. 9 0
      frameworks/PHP/kumbiaphp/deploy/php
  40. 18 0
      frameworks/PHP/kumbiaphp/setup.sh
  41. 3 2
      frameworks/PHP/limonade/deploy/nginx.conf
  42. 3 2
      frameworks/PHP/lithium/deploy/nginx.conf
  43. 3 2
      frameworks/PHP/lumen/deploy/nginx.conf
  44. 4 4
      frameworks/PHP/phalcon-micro/README.md
  45. 3 2
      frameworks/PHP/phalcon-micro/deploy/nginx.conf
  46. 5 5
      frameworks/PHP/phalcon/README.md
  47. 3 2
      frameworks/PHP/phalcon/deploy/nginx.conf
  48. 4 7
      frameworks/PHP/php/dborm.php
  49. 7 12
      frameworks/PHP/php/dbraw.php
  50. 3 3
      frameworks/PHP/php/deploy/nginx.conf
  51. 4 22
      frameworks/PHP/php/fortune.php
  52. 2 0
      frameworks/PHP/php/info.php
  53. 2 12
      frameworks/PHP/php/json.php
  54. 9 17
      frameworks/PHP/php/updateraw.php
  55. 3 2
      frameworks/PHP/phpixie/deploy/nginx.conf
  56. 3 2
      frameworks/PHP/phreeze/deploy/nginx.conf
  57. 3 2
      frameworks/PHP/silex-orm/deploy/nginx.conf
  58. 3 2
      frameworks/PHP/silex/deploy/nginx.conf
  59. 3 2
      frameworks/PHP/silex/deploy/nginx_raw.conf
  60. 3 2
      frameworks/PHP/symfony/deploy/nginx.conf
  61. 3 2
      frameworks/PHP/yaf/deploy/nginx.conf
  62. 3 2
      frameworks/PHP/yii2/deploy/nginx.conf
  63. 3 2
      frameworks/PHP/zend/deploy/nginx.conf
  64. 3 2
      frameworks/PHP/zend1/deploy/nginx.conf
  65. 1 1
      toolset/setup/linux/frameworks/phalcon.sh
  66. 1 4
      toolset/setup/linux/languages/hhvm.sh
  67. 6 6
      toolset/setup/linux/languages/php/php-fpm.conf
  68. 1 1
      toolset/setup/linux/languages/php/php7.sh

+ 1 - 0
.travis.yml

@@ -137,6 +137,7 @@ env:
     - "TESTDIR=PHP/fat-free"
     - "TESTDIR=PHP/fuel"
     - "TESTDIR=PHP/kohana"
+    - "TESTDIR=PHP/kumbiaphp"
     - "TESTDIR=PHP/laravel"
     - "TESTDIR=PHP/limonade"
     - "TESTDIR=PHP/lithium"

+ 1 - 1
frameworks/PHP/README.md

@@ -9,7 +9,7 @@ For further guidance, review the
 ### PHP Versions
 
 [PHP 7.2.2](https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/toolset/setup/linux/languages/php/php7.sh),
-[PHP 5.6.33](https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/toolset/setup/linux/languages/php/php5.sh) and [HHVM 3.21](https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/toolset/setup/linux/languages/hhvm.sh).
+[PHP 5.6.33](https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/toolset/setup/linux/languages/php/php5.sh) and [HHVM 3.24](https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/toolset/setup/linux/languages/hhvm.sh).
 
 ## Adding New PHP-based Frameworks
 

+ 3 - 2
frameworks/PHP/cakephp/deploy/nginx.conf

@@ -1,7 +1,7 @@
-worker_processes  8;
+worker_processes  auto;
 
 events {
-    worker_connections 2048;
+    worker_connections 16384;
 	multi_accept on;
 	use epoll;
 }
@@ -10,6 +10,7 @@ http {
     include       /home/vagrant/FrameworkBenchmarks/installs/nginx/conf/mime.types;
     default_type  application/octet-stream;
     access_log off;
+    server_tokens off;
 
     sendfile on;
     tcp_nopush on;

+ 3 - 2
frameworks/PHP/clancats/deploy/nginx.conf

@@ -1,9 +1,9 @@
-worker_processes  8;
+worker_processes  auto;
 
 error_log stderr error;
 
 events {
-	worker_connections  1024;
+	worker_connections  16384;
 }
 
 http {
@@ -11,6 +11,7 @@ http {
 	default_type  application/octet-stream;
 
 	access_log off;
+	server_tokens off;
 
 	sendfile        on;
 	keepalive_timeout  65;

+ 3 - 2
frameworks/PHP/codeigniter/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-  worker_connections  1024;
+  worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
   #access_log  logs/access.log  main;
   access_log off;
+  server_tokens off;
 
   sendfile        on;
   #tcp_nopush     on;

+ 3 - 2
frameworks/PHP/cygnite/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 3 - 2
frameworks/PHP/fat-free/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 3 - 2
frameworks/PHP/fuel/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 3 - 2
frameworks/PHP/hhvm/deploy/nginx.conf

@@ -1,14 +1,15 @@
-worker_processes  8;
+worker_processes  auto;
 error_log stderr error;
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 http {
     include       /usr/local/nginx/conf/mime.types;
     default_type  application/octet-stream;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     keepalive_timeout  65;

+ 3 - 2
frameworks/PHP/kohana/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 2 - 0
frameworks/PHP/kumbiaphp/.gitignore

@@ -0,0 +1,2 @@
+vendor
+bench/public/info.php

+ 42 - 0
frameworks/PHP/kumbiaphp/README.md

@@ -0,0 +1,42 @@
+[![KumbiaPHP logo](https://rawgit.com/kumbiaphp/kumbiaphp/1.0/default/public/img/kumbiaphp.svg)](https://github.com/KumbiaPHP/KumbiaPHP) 
+
+[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/KumbiaPHP/KumbiaPHP/badges/quality-score.png?b=1.0)](https://scrutinizer-ci.com/g/KumbiaPHP/KumbiaPHP/?branch=1.0)
+[![Code Climate](https://codeclimate.com/github/KumbiaPHP/KumbiaPHP/badges/gpa.svg)](https://codeclimate.com/github/KumbiaPHP/KumbiaPHP)
+![PHP7 ready](https://rawgit.com/kumbiaphp/kumbiaphp/1.0/default/public/img/php7.svg)
+
+# KumbiaPHP Benchmarking Test
+
+This is the KumbiaPHP portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
+
+### JSON Encoding Test
+Uses the PHP standard [JSON encoder](http://www.php.net/manual/en/function.json-encode.php).
+
+* [JSON test controller](bench/app/controllers/json_controller.php)
+
+
+### Data-Store/Database Mapping Test
+
+* [DB test controller](bench/app/controllers/db_controller.php)
+
+
+## Infrastructure Software Versions
+The tests were run with:
+
+* [KumbiaPHP Version 1.0](https://github.com/KumbiaPHP/KumbiaPHP)
+* [PHP Version 7.2.22](http://www.php.net/) with FPM and OPCache
+* [nginx 1.12.2](http://nginx.org/)
+* [MySQL 5.7.21](https://dev.mysql.com/)
+
+## Test URLs
+### JSON Encoding Test
+
+http://localhost/json
+
+### Data-Store/Database Mapping Test
+
+http://localhost/db/
+
+### Variable Query Test
+    
+http://localhost/db/queries/2
+

+ 38 - 0
frameworks/PHP/kumbiaphp/bench/app/config/config.ini

@@ -0,0 +1,38 @@
+;; Configuracion de Aplicacion
+
+; Explicación de la Configuración:
+
+; name: Es el nombre de la aplicación
+; database: base de datos a utilizar
+; dbdate: Formato de Fecha por defecto de la Applicación
+; debug: muestra los errores en pantalla (On|off)
+; log_exceptions: muestra las excepciones en pantalla (On|off)
+; cache_template: descomentar para habilitar cache de template
+; cache_driver: driver para la cache (file, sqlite, memsqlite)
+; metadata_lifetime: Tiempo de vida de la metadata cacheada
+; locale: Localicazion
+; routes: para activar los routes.ini
+
+
+; ¡¡¡ ADVERTENCIA !!!
+; Cuando se efectua el cambio de production=Off, a production=On, es necesario eliminar
+; el contenido del directorio de cache de la aplicacion para que se renueve
+; la metadata
+
+[application]
+name = "KUMBIA BENCH" 
+database = development
+dbdate = YYYY-MM-DD
+debug = Off
+log_exceptions = Off
+;cache_template = On
+cache_driver = nixfile
+metadata_lifetime = "+1 year"
+namespace_auth = "default"
+;routes = On
+
+
+; Deprecated configs that are from server not the application
+; timezone: Es la zona horaria que usará el framework, cambiarla http://php.net/manual/es/timezones.php
+; production: Indica si esta en producción
+; charset: codificacion de caracteres

+ 16 - 0
frameworks/PHP/kumbiaphp/bench/app/config/config.php

@@ -0,0 +1,16 @@
+<?php
+
+return [
+'application' => [
+    'name' => 'KUMBIA PROJECT',
+    'database' => 'default',
+    'dbdate' => 'YYYY-MM-DD',
+    'debug' => 'Off',
+    'log_exceptions' => 'Off',
+    //'cache_template' => 'On',
+    'cache_driver' => 'nixfile',
+    'metadata_lifetime' => '+1 year',
+    'namespace_auth' => 'default',
+    //'routes' => 'On',
+    ],
+];

+ 11 - 0
frameworks/PHP/kumbiaphp/bench/app/config/databases.php

@@ -0,0 +1,11 @@
+<?php
+//Conexión a Mysql
+return ['default' => [
+            'dsn' => 'mysql:host=TFB-database;dbname=hello_world',
+            'username' => 'benchmarkdbuser',
+            'password' => 'benchmarkdbpass',
+            'params' => [
+                PDO::ATTR_PERSISTENT => true, //conexión persistente
+            ]
+        ],
+    ];

+ 38 - 0
frameworks/PHP/kumbiaphp/bench/app/controllers/db_controller.php

@@ -0,0 +1,38 @@
+<?php
+
+class DbController extends AppController
+{
+    protected function before_filter()
+    {
+        View::select(null, null);
+        header('Content-type: application/json');
+    }
+
+    public function index()
+    {
+        echo json_encode(World::byId(mt_rand(1, 10000)));
+    }
+
+    public function queries($count = 1)
+    {
+        $count = is_numeric($count) ? min(max($count, 1), 500) : 1;
+        $worlds = [];
+        for ($i = 0; $i < $count; ++$i) {
+            $worlds[] = World::byId(mt_rand(1, 10000));
+        }
+        echo json_encode($worlds);
+    }
+
+    public function update($count = 1)
+    {
+        $count = is_numeric($count) ? min(max($count, 1), 500) : 1;
+        $worlds = [];
+        for ($i = 0; $i < $count; ++$i) {
+            $row = World::byId(mt_rand(1, 10000));
+            $row->randomNumber = mt_rand(1, 10000);
+            $row->update();
+            $worlds[] = $row;
+        }
+        echo json_encode($worlds);
+    }
+}

+ 13 - 0
frameworks/PHP/kumbiaphp/bench/app/controllers/fortune_controller.php

@@ -0,0 +1,13 @@
+<?php
+
+class FortuneController extends AppController
+{
+    public function index()
+    {
+        View::select(null,'fortune');
+        $data = World::all('SELECT id, message FROM Fortune');
+        $data[] = (object) ['id' => 0,'message' => 'Additional fortune added at request time.'];
+        usort($data, function($a, $b){return strcmp($a->message, $b->message);});
+        $this->data = $data;
+    }
+}

+ 16 - 0
frameworks/PHP/kumbiaphp/bench/app/controllers/index_controller.php

@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * Controller por defecto si no se usa el routes
+ *
+ */
+class IndexController extends AppController
+{
+
+    public function index()
+    {
+        View::select(null, null);
+        header('Content-type: text/plain');
+        echo 'Hello, World!';
+    }
+}

+ 12 - 0
frameworks/PHP/kumbiaphp/bench/app/controllers/json_controller.php

@@ -0,0 +1,12 @@
+<?php
+
+class JsonController extends AppController
+{
+
+    public function index()
+    {
+        View::select(null, null);
+        header('Content-type: application/json');
+        echo json_encode(['message' => 'Hello, World!']);
+    }
+}

+ 59 - 0
frameworks/PHP/kumbiaphp/bench/app/controllers/raw_controller.php

@@ -0,0 +1,59 @@
+<?php
+
+class RawController extends AppController
+{
+    protected $pdo;
+
+    protected function before_filter()
+    {
+        View::select(null, null);
+        header('Content-type: application/json');
+
+        $this->pdo = new PDO('mysql:host=TFB-database;dbname=hello_world', 'benchmarkdbuser', 'benchmarkdbpass', array(
+            PDO::ATTR_PERSISTENT => true
+        ));
+    }
+
+    public function index()
+    {
+        $res = $this->pdo->prepare('SELECT randomNumber FROM World WHERE id = ?');
+        $id = mt_rand(1, 10000);
+        $res->execute(array($id));
+        echo json_encode(['id' => $id, 'randomNumber' => $res->fetchColumn()]);
+    }
+
+    public function queries($count = 1)
+    {
+        //$queries = ($queries < 1) ? 1 : (($queries > 500) ? 500 : $queries);
+        $count = is_numeric($count) ? min(max($count, 1), 500) : 1;
+        $res = $this->pdo->prepare('SELECT randomNumber FROM World WHERE id = ?');
+        $worlds = [];
+        for ($i = 0; $i < $count; ++$i) {
+            $id = mt_rand(1, 10000);
+            $res->execute(array($id));
+            $worlds[] = array('id' => $id, 'randomNumber' => $res->fetchColumn());
+        }
+        echo json_encode($worlds);
+    }
+
+    public function update($count = 1)
+    {
+        $count = is_numeric($count) ? min(max($count, 1), 500) : 1;
+        $worlds = [];
+        
+        $sth = $this->pdo->prepare('SELECT * FROM World WHERE id = ?');
+        $updateSth = $this->pdo->prepare('UPDATE World SET randomNumber = ? WHERE id = ?');
+        
+        for ($i = 0; $i < $count; ++$i) {
+            $id = mt_rand(1, 10000);
+            $randomNumber = mt_rand(1, 10000);
+
+            $sth->execute(array($id));
+            $row = ['id' => $id, 'randomNumber' => $updateSth->fetchColumn()];
+            $row['randomNumber'] = $randomNumber;
+            $updateSth->execute([$randomNumber, $id]);
+            $worlds[] = $row;
+        }
+        echo json_encode($worlds);
+    }
+}

+ 20 - 0
frameworks/PHP/kumbiaphp/bench/app/controllers/raw_fortune_controller.php

@@ -0,0 +1,20 @@
+<?php
+
+class RawFortuneController extends AppController
+{
+    public function index()
+    {
+        View::select(null,'raw');
+        $pdo = new PDO('mysql:host=TFB-database;dbname=hello_world', 'benchmarkdbuser', 'benchmarkdbpass', array(
+            PDO::ATTR_PERSISTENT => true
+        ));
+        $res = $pdo->query('SELECT id, message FROM Fortune', PDO::FETCH_ASSOC);
+        $data = $res->fetchAll();
+        
+        array_push($data, array('id'=> 0, 'message' => 'Additional fortune added at request time.'));
+        usort($data, function($left, $right) {
+            return strcmp($left['message'], $right['message']);
+        });
+        $this->data = $data;
+    }
+}

+ 33 - 0
frameworks/PHP/kumbiaphp/bench/app/libs/admin_controller.php

@@ -0,0 +1,33 @@
+<?php
+/**
+ * @see Controller nuevo controller
+ */
+require_once CORE_PATH . 'kumbia/controller.php';
+
+/**
+ * Controlador para proteger los controladores que heredan
+ * Para empezar a crear una convención de seguridad y módulos
+ *
+ * Todas las controladores heredan de esta clase en un nivel superior
+ * por lo tanto los metodos aqui definidos estan disponibles para
+ * cualquier controlador.
+ *
+ * @category Kumbia
+ * @package Controller
+ */
+class AdminController extends Controller
+{
+
+    final protected function initialize()
+    {
+        //Código de auth y permisos
+        //Será libre, pero añadiremos uno por defecto en breve
+        //Posiblemente se cree una clase abstracta con lo que debe tener por defecto
+    }
+
+    final protected function finalize()
+    {
+        
+    }
+
+}

+ 30 - 0
frameworks/PHP/kumbiaphp/bench/app/libs/app_controller.php

@@ -0,0 +1,30 @@
+<?php
+/**
+ * @see Controller nuevo controller
+ */
+require_once CORE_PATH . 'kumbia/controller.php';
+
+/**
+ * Controlador principal que heredan los controladores
+ *
+ * Todas las controladores heredan de esta clase en un nivel superior
+ * por lo tanto los metodos aqui definidos estan disponibles para
+ * cualquier controlador.
+ *
+ * @category Kumbia
+ * @package Controller
+ */
+class AppController extends Controller
+{
+
+    final protected function initialize()
+    {
+
+    }
+
+    final protected function finalize()
+    {
+        
+    }
+
+}

+ 32 - 0
frameworks/PHP/kumbiaphp/bench/app/libs/rest_controller.php

@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * Controlador para manejar peticiones REST
+ * 
+ * Por defecto cada acción se llama como el método usado por el cliente
+ * (GET, POST, PUT, DELETE, OPTIONS, HEADERS, PURGE...)
+ * ademas se puede añadir mas acciones colocando delante el nombre del método
+ * seguido del nombre de la acción put_cancel, post_reset...
+ *
+ * @category Kumbia
+ * @package Controller
+ * @author kumbiaPHP Team
+ */
+require_once CORE_PATH . 'kumbia/kumbia_rest.php';
+class RestController extends KumbiaRest {
+
+    /**
+     * Inicialización de la petición
+     * ****************************************
+     * Aqui debe ir la autenticación de la API
+     * ****************************************
+     */
+    final protected function initialize() {
+        
+    }
+
+    final protected function finalize() {
+        
+    }
+
+}

+ 87 - 0
frameworks/PHP/kumbiaphp/bench/app/libs/scaffold_controller.php

@@ -0,0 +1,87 @@
+<?php
+
+/**
+ * Controlador base para la construcción de CRUD para modelos rápidamente
+ *
+ * @category Kumbia
+ * @package Controller
+ */
+class ScaffoldController extends AdminController
+{
+    /** @var string Carpeta en views/_shared/scaffolds/ */
+    public $scaffold = 'kumbia';
+    /** @var string Nombre del modelo en CamelCase */
+    public $model = '';
+
+    /**
+     * Resultados paginados
+     */
+    public function index($page = 1)
+    {
+        $this->data = (new $this->model)->paginate("page: $page", 'order: id desc');
+    }
+
+    /**
+     * Crea un Registro
+     */
+    public function crear()
+    {
+        if (Input::hasPost($this->model)) {
+
+            $obj = new $this->model;
+            //En caso que falle la operación de guardar
+            if (!$obj->save(Input::post($this->model))) {
+                Flash::error('Falló Operación');
+                //se hacen persistente los datos en el formulario
+                $this->{$this->model} = $obj;
+                return;
+            }
+            return Redirect::to();
+        }
+        // Sólo es necesario para el autoForm
+        $this->{$this->model} = new $this->model;
+    }
+
+    /**
+     * Edita un Registro
+     */
+    public function editar($id)
+    {
+        View::select('crear');
+
+        //se verifica si se ha enviado via POST los datos
+        if (Input::hasPost($this->model)) {
+            $obj = new $this->model;
+            if (!$obj->update(Input::post($this->model))) {
+                Flash::error('Falló Operación');
+                //se hacen persistente los datos en el formulario
+                $this->{$this->model} = Input::post($this->model);
+            } else {
+                return Redirect::to();
+            }
+        }
+
+        //Aplicando la autocarga de objeto, para comenzar la edición
+        $this->{$this->model} = (new $this->model)->find((int) $id);
+    }
+
+    /**
+     * Borra un Registro
+     */
+    public function borrar($id)
+    {
+        if (!(new $this->model)->delete((int) $id)) {
+            Flash::error('Falló Operación');
+        }
+        //enrutando al index para listar los articulos
+        Redirect::to();
+    }
+
+    /**
+     * Ver un Registro
+     */
+    public function ver($id)
+    {
+        $this->data = (new $this->model)->find_first((int) $id);
+    }
+}

+ 16 - 0
frameworks/PHP/kumbiaphp/bench/app/libs/view.php

@@ -0,0 +1,16 @@
+<?php
+/**
+ * @see KumbiaView
+ */
+require_once CORE_PATH . 'kumbia/kumbia_view.php';
+
+/**
+ * Esta clase permite extender o modificar la clase ViewBase de Kumbiaphp.
+ *
+ * @category KumbiaPHP
+ * @package View
+ */
+class View extends KumbiaView
+{
+
+}

+ 9 - 0
frameworks/PHP/kumbiaphp/bench/app/models/fortune.php

@@ -0,0 +1,9 @@
+<?php
+
+class Fortune extends \Kumbia\ActiveRecord\LiteRecord
+{
+    public static function all()
+    {
+        return parent::all('SELECT id, message FROM Fortune');
+    }
+}

+ 9 - 0
frameworks/PHP/kumbiaphp/bench/app/models/world.php

@@ -0,0 +1,9 @@
+<?php
+
+class World extends \Kumbia\ActiveRecord\LiteRecord
+{
+    public static function byId($id)
+    {
+        return self::first('SELECT id, randomNumber FROM World WHERE id = ?', $id);
+    }
+}

+ 24 - 0
frameworks/PHP/kumbiaphp/bench/app/views/_shared/templates/default.phtml

@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="es">
+ <head>
+  <meta charset=<?= APP_CHARSET ?> >
+  <title>KumbiaPHP Framework</title>
+  <meta name="viewport" content="width=device-width, initial-scale=1">
+  <?php Tag::css('kumbia') ?>
+  <?= Html::includeCss() ?>
+</head>
+<body>
+<div class="container">
+  <header class="row">
+      <div class="col-8">
+        <?= Html::img('kumbiaphp.svg', 'KumbiaPHP logo') ?>
+      </div>
+      <div class="col-4 text-right">
+          App: <strong><?= basename(dirname(APP_PATH)) ?></strong> (<?= PRODUCTION ? 'Production' : 'Development' ?>)
+      </div>
+  </header>
+  <?php View::content() ?>
+  <?php View::partial('kumbia/footer') ?>
+</div>
+</body>
+</html>

+ 4 - 0
frameworks/PHP/kumbiaphp/bench/app/views/_shared/templates/fortune.phtml

@@ -0,0 +1,4 @@
+<!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>
+<?php foreach ($data as $item) : ?>
+<tr><td><?= $item->id ?></td><td><?= h($item->message) ?></td></tr>
+<?php endforeach ?></table></body></html>

+ 2 - 0
frameworks/PHP/kumbiaphp/bench/app/views/_shared/templates/hello.phtml

@@ -0,0 +1,2 @@
+<?php header('Content-type: text/plain') ?>
+Hello, World!

+ 4 - 0
frameworks/PHP/kumbiaphp/bench/app/views/_shared/templates/json.phtml

@@ -0,0 +1,4 @@
+<?php
+/*mime type para el contenido*/
+header('Content-type: application/json');
+echo json_encode($data);

+ 4 - 0
frameworks/PHP/kumbiaphp/bench/app/views/_shared/templates/raw.phtml

@@ -0,0 +1,4 @@
+<!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>
+<?php foreach ($data as $key => $value) : ?>
+<tr><td><?= $value['id'] ?></td><td><?= h($value['message']) ?></td></tr>
+<?php endforeach ?></table></body></html>

+ 34 - 0
frameworks/PHP/kumbiaphp/bench/public/.user.ini

@@ -0,0 +1,34 @@
+; Config PHP for FastCGi, FPM,...  (nginx for example)
+; like .htaccess but better
+; see http://php.net/manual/en/configuration.file.per-user.php
+; see http://php.net/manual/en/ini.core.php
+; check your php.ini for:
+;user_ini.filename
+;user_ini.cache_ttl
+
+;display_errors = On  ; OFF in production
+;html_errors = On
+;error_reporting = -1
+;default_charset = "UTF-8" ; before PHP 5.6
+;date.timezone = "Europe/Madrid"
+;magic_quotes_gpc = Off
+;open_basedir = "/your-path"
+
+
+;upload_max_filesize = 1000M
+;post_max_size = 1005M
+;memory_limit = 64M
+;max_execution_time = 120
+
+;session see http://php.net/manual/en/session.configuration.php
+;session.name = "SSID"
+;session.cookie_httponly = 1 ; No access from DOM (js)
+;session.cookie_secure = 1 ;only send with https
+;session.save_handler=memcache ; handler (redis, rediscluster, memcache, ...)
+;session.auto_start = 1  ; always start session automatically
+;session.cookie_lifetime = 84600  ; session lifetime to 1 day
+;session.gc_maxlifetime = 84600   ; session lifetime to 1 day
+
+;opcache.enable = Off
+;opcache.validate_timestamps = On
+;opcache.load_comments = Off ; Removed in PHP 7.0.0.

BIN
frameworks/PHP/kumbiaphp/bench/public/favicon.ico


+ 97 - 0
frameworks/PHP/kumbiaphp/bench/public/index.php

@@ -0,0 +1,97 @@
+<?php
+/**
+ * KumbiaPHP web & app Framework.
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://wiki.kumbiaphp.com/Licencia
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to [email protected] so we can send you a copy immediately.
+ *
+ * @copyright  Copyright (c) 2005 - 2017 Kumbia Team (http://www.kumbiaphp.com)
+ * @license    http://wiki.kumbiaphp.com/Licencia     New BSD License
+ */
+
+/**
+ * Esta sección prepara el entorno
+ * Todo esto se puede hacer desde la configuracion del
+ * Servidor/PHP, en caso de no poder usarlo desde ahí
+ * Puedes descomentar  estas lineas.
+ */
+
+//*Locale*
+//setlocale(LC_ALL, 'es_ES');
+
+//*Timezone*
+//ini_set('date.timezone', 'America/New_York');
+
+/**
+ * @TODO
+ * REVISAR ESTA SECCIÓN
+ */
+const APP_CHARSET = 'UTF-8';
+/**
+ * Indicar si la aplicacion se encuentra en produccion
+ * directamente desde el index.php.
+ */
+const PRODUCTION = false;
+
+/**
+ * Descomentar para mostrar los errores.
+ */
+//error_reporting(E_ALL ^ E_STRICT);ini_set('display_errors', 'On');
+
+/**
+ * Define el APP_PATH.
+ *
+ * APP_PATH:
+ * - Ruta al directorio de la aplicación (por defecto la ruta al directorio app)
+ * - Esta ruta se utiliza para cargar los archivos de la aplicacion
+ * - En producción, es recomendable ponerla manual
+ */
+//define('APP_PATH', dirname(__DIR__).'/app/');
+const APP_PATH = 'APP_ROOT';
+/**
+ * Define el CORE_PATH.
+ *
+ * CORE_PATH:
+ * - Ruta al directorio que contiene el núcleo de Kumbia (por defecto la ruta al directorio core)
+ */
+//define('CORE_PATH', dirname(dirname(APP_PATH)).'/vendor/Kumbia/core/');
+const CORE_PATH = 'CORE_ROOT';
+/**
+ * Define el PUBLIC_PATH.
+ *
+ * PUBLIC_PATH:
+ * - Path para genera la Url en los links a acciones y controladores
+ * - Esta ruta la utiliza Kumbia como base para generar las Urls para acceder de lado de
+ *   cliente (con el navegador web) y es relativa al DOCUMENT_ROOT del servidor web
+ *
+ *  EN PRODUCCION ESTA CONSTANTE DEBERÍA SER ESTABLECIDA MANUALMENTE
+ */
+//define('PUBLIC_PATH', substr($_SERVER['SCRIPT_NAME'], 0, -9)); // - index.php string[9]
+const PUBLIC_PATH = '/';
+
+ /**
+  * Obtiene la url usando PATH_INFO.
+  */
+//$url = empty($_SERVER['PATH_INFO']) ? '/' : $_SERVER['PATH_INFO'];
+
+ /**
+  * Obtiene la url usando $_GET['_url']
+  * Cambiar también en el .htaccess.
+  */
+ $url = $_GET['_url'] ?? '/';
+
+/**
+ * Carga el gestor de arranque
+ * Por defecto el bootstrap del core.
+ *
+ * @see Bootstrap
+ */
+//require APP_PATH . 'libs/bootstrap.php'; //bootstrap de app
+require CORE_PATH.'kumbia/bootstrap.php'; //bootstrap del core

+ 51 - 0
frameworks/PHP/kumbiaphp/benchmark_config.json

@@ -0,0 +1,51 @@
+{
+    "framework": "kumbiaphp",
+    "tests": [{
+        "default": {
+            "setup_file": "setup",
+            "plaintext_url": "/",
+            "json_url": "/json",
+            "db_url": "/db",
+            "query_url": "/db/queries/",
+            "fortune_url": "/fortune",
+            "update_url": "/db/update/",
+            "port": 8080,
+            "approach": "Realistic",
+            "classification": "Fullstack",
+            "database": "MySQL",
+            "framework": "KumbiaPHP",
+            "language": "PHP",
+            "flavor": "PHP7",
+            "orm": "micro",
+            "platform": "None",
+            "webserver": "nginx",
+            "os": "Linux",
+            "database_os": "Linux",
+            "display_name": "kumbiaphp",
+            "notes": "",
+            "versus": "php7"
+        },
+        "raw": {
+            "setup_file": "setup",
+            "db_url": "/raw",
+            "query_url": "/raw/queries/",
+            "fortune_url": "/raw-fortune",
+            "update_url": "/raw/update/",
+            "port": 8080,
+            "approach": "Realistic",
+            "classification": "Fullstack",
+            "database": "MySQL",
+            "framework": "KumbiaPHP",
+            "language": "PHP",
+            "flavor": "PHP7",
+            "orm": "Raw",
+            "platform": "None",
+            "webserver": "nginx",
+            "os": "Linux",
+            "database_os": "Linux",
+            "display_name": "kumbiaphp-raw",
+            "notes": "",
+            "versus": "php7"
+          }
+        }]
+      }

+ 65 - 0
frameworks/PHP/kumbiaphp/deploy/nginx.conf

@@ -0,0 +1,65 @@
+#user  nobody;
+worker_processes  auto;
+
+error_log stderr error;
+#pid        logs/nginx.pid;
+
+events {
+    worker_connections  16384;
+}
+
+http {
+    include       INSTALL_ROOT/nginx/conf/mime.types;
+    default_type  application/octet-stream;
+
+    #access_log  logs/access.log  main;
+    access_log off;
+    server_tokens off;
+
+    sendfile        on;
+    #tcp_nopush     on;
+
+    keepalive_timeout  65;
+
+    #gzip  on;
+    upstream fastcgi_backend {
+        server 127.0.0.1:9001;
+        keepalive 50;
+    }
+    server {
+        listen       8080;
+        server_name  localhost;
+
+        #location / {
+        #    root   html;
+        #    index  index.html index.htm;
+        #}
+
+
+        root TEST_ROOT;
+        index  index.php;
+
+        location / {
+            try_files $uri /index.php?_url=$uri&$args;
+        }
+
+        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9001
+        #
+        location ~ \.php$ {
+            try_files $uri =404;
+            fastcgi_pass   fastcgi_backend;
+            fastcgi_keep_conn on;
+            fastcgi_index  index.php;
+#            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            include        INSTALL_ROOT/nginx/conf/fastcgi_params;
+        }
+
+        # deny access to .htaccess files, if Apache's document root
+        # concurs with nginx's one
+        #
+        #location ~ /\.ht {
+        #    deny  all;
+        #}
+    }
+}

+ 9 - 0
frameworks/PHP/kumbiaphp/deploy/php

@@ -0,0 +1,9 @@
+<VirtualHost *:8080>
+  Alias /php/ "TEST_ROOT"
+  <Directory TEST_ROOT>
+          Options Indexes FollowSymLinks MultiViews
+          #AllowOverride None
+          Order allow,deny
+          allow from all
+  </Directory>
+</VirtualHost>

+ 18 - 0
frameworks/PHP/kumbiaphp/setup.sh

@@ -0,0 +1,18 @@
+#!/bin/bash
+
+fw_depends mysql php7 nginx
+
+sed -i "s|APP_ROOT|${TROOT}/bench/app/|g" bench/public/index.php
+sed -i "s|CORE_ROOT|${TROOT}/vendor/Kumbia/core/|g" bench/public/index.php
+sed -i "s|TEST_ROOT|${TROOT}/bench/public/|g" deploy/php
+sed -i "s|TEST_ROOT|${TROOT}/bench/public/|g" deploy/nginx.conf
+sed -i "s|INSTALL_ROOT|${IROOT}|g" deploy/nginx.conf
+
+
+[[ ! -e vendor/Kumbia ]] || rm -rf vendor/Kumbia
+
+git clone -b v1.0.0-rc.2 --single-branch --depth 1 https://github.com/KumbiaPHP/KumbiaPHP.git vendor/Kumbia
+git clone -b v0.4.0 --single-branch --depth 1 https://github.com/KumbiaPHP/ActiveRecord.git vendor/Kumbia/ActiveRecord
+
+php-fpm --fpm-config $FWROOT/toolset/setup/linux/languages/php/php-fpm.conf -g /tmp/php-fpm.pid
+nginx -c $TROOT/deploy/nginx.conf

+ 3 - 2
frameworks/PHP/limonade/deploy/nginx.conf

@@ -1,15 +1,16 @@
-worker_processes  8;
+worker_processes  auto;
 
 error_log stderr error;
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 http {
     include       /usr/local/nginx/conf/mime.types;
     default_type  application/octet-stream;
     access_log off;
+    server_tokens off;
     sendfile        on;
     keepalive_timeout  65;
 

+ 3 - 2
frameworks/PHP/lithium/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 3 - 2
frameworks/PHP/lumen/deploy/nginx.conf

@@ -1,15 +1,16 @@
-worker_processes  8;
+worker_processes  auto;
 
 error_log stderr error;
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 http {
     include /usr/local/nginx/conf/mime.types;    
     default_type  application/octet-stream;
     access_log off;
+    server_tokens off;
     sendfile        on;
     keepalive_timeout  65;
 

+ 4 - 4
frameworks/PHP/phalcon-micro/README.md

@@ -22,10 +22,10 @@ Uses Phalcon's template engine 'Volt'
 ## Infrastructure Software Versions
 The tests were run with:
 
-* [Phalcon 3.2.4](http://phalconphp.com/)
-* [PHP Version 5.6.32](http://www.php.net/) with FPM, APC and Phalcon extension
-* [nginx 1.12.0](http://nginx.org/)
-* [MySQL 5.7.20](https://dev.mysql.com/)
+* [Phalcon 3.3.1](http://phalconphp.com/)
+* [PHP Version 5.6.33](http://www.php.net/) with FPM, APC and Phalcon extension
+* [nginx 1.12.2](http://nginx.org/)
+* [MySQL 5.7.21](https://dev.mysql.com/)
 
 ## Test URLs
 ### JSON Encoding Test

+ 3 - 2
frameworks/PHP/phalcon-micro/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 5 - 5
frameworks/PHP/phalcon/README.md

@@ -23,11 +23,11 @@ Uses Phalcons template engine 'Volt'
 ## Infrastructure Software Versions
 The tests were run with:
 
-* [Phalcon 3.2.4](http://phalconphp.com/)
-* [PHP Version 7.2.1](http://www.php.net/) with FPM, OPcache and Phalcon extension
-* [nginx 1.12.0](http://nginx.org/)
-* [MySQL 5.5.54](https://dev.mysql.com/)
-* [MongoDB 2.4.8](https://mongodb.org/)
+* [Phalcon 3.3.1](http://phalconphp.com/)
+* [PHP Version 7.2.2](http://www.php.net/) with FPM, OPcache and Phalcon extension
+* [nginx 1.12.2](http://nginx.org/)
+* [MySQL 5.7.21](https://dev.mysql.com/)
+* [MongoDB 3.6](https://mongodb.org/)
 
 ## Test URLs
 ### JSON Encoding Test

+ 3 - 2
frameworks/PHP/phalcon/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 4 - 7
frameworks/PHP/php/dborm.php

@@ -1,8 +1,4 @@
 <?php
-//
-// Database Test
-//
-
 // Set content type
 header("Content-type: application/json");
 
@@ -23,7 +19,7 @@ ActiveRecord\Config::initialize(function($cfg)
 // Read number of queries to run from URL parameter
 $query_count = 1;
 if (isset($_GET['queries']) && $_GET['queries'] > 0) {
-  $query_count = $_GET["queries"];
+  $query_count = $_GET["queries"] > 500 ? 500 : $_GET['queries'];
 }
 
 // Create an array with the response string.
@@ -40,8 +36,9 @@ for ($i = 0; $i < $query_count; $i++) {
   // Store result in array.
   $arr[] = $world->to_array();
 }
-
+if ($query_count === 1) {
+  $arr = $arr[0];
+}
 // Use the PHP standard JSON encoder.
 // http://www.php.net/manual/en/function.json-encode.php
 echo json_encode($arr);
-?>

+ 7 - 12
frameworks/PHP/php/dbraw.php

@@ -1,7 +1,5 @@
 <?php
-//
-// Database Test
-//
+header('Content-type: application/json');
 
 // Database connection
 // http://www.php.net/manual/en/ref.pdo-mysql.php
@@ -12,31 +10,28 @@ $pdo = new PDO('mysql:host=TFB-database;dbname=hello_world', 'benchmarkdbuser',
 // Read number of queries to run from URL parameter
 $query_count = 1;
 if (isset($_GET['queries']) && $_GET['queries'] > 0) {
-  $query_count = $_GET['queries'];
+  $query_count = $_GET['queries'] > 500 ? 500 : $_GET['queries'];
 }
 
 // Create an array with the response string.
 $arr = array();
-$id = mt_rand(1, 10000);
 
 // Define query
-$statement = $pdo->prepare('SELECT randomNumber FROM World WHERE id = :id');
-$statement->bindParam(':id', $id, PDO::PARAM_INT);
+$statement = $pdo->prepare('SELECT randomNumber FROM World WHERE id = ?');
 
 // For each query, store the result set values in the response array
 while (0 < $query_count--) {
-  $statement->execute();
+  $id = mt_rand(1, 10000);
+  $statement->execute(array($id));
   
   // Store result in array.
   $arr[] = array('id' => $id, 'randomNumber' => $statement->fetchColumn());
-  $id = mt_rand(1, 10000);
 }
 
 // Use the PHP standard JSON encoder.
 // http://www.php.net/manual/en/function.json-encode.php
-if (count($arr) == 1) {
-  $arr = $arr[0];
+if (count($arr) === 1) {
+      $arr = $arr[0];
 }
 
 echo json_encode($arr);
-?>

+ 3 - 3
frameworks/PHP/php/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,10 +10,9 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
-
 http {
     include       /usr/local/nginx/conf/mime.types;
     default_type  application/octet-stream;
@@ -32,6 +31,7 @@ http {
     keepalive_timeout  65;
 
     #gzip  on;
+    server_tokens off;
 
     upstream fastcgi_backend {
         server 127.0.0.1:9001;

+ 4 - 22
frameworks/PHP/php/fortune.php

@@ -18,25 +18,7 @@ $arr[0] = 'Additional fortune added at request time.';
 
 asort($arr);
 ?>
-<!DOCTYPE html>
-<html>
-<head>
-<title>Fortunes</title>
-</head>
-<body>
-<table>
-<tr>
-<th>id</th>
-<th>message</th>
-</tr>
-<?php
-foreach ( $arr as $id => $fortune ) {
-?>
-<tr>
-<td><?php echo htmlspecialchars($id, ENT_QUOTES, 'UTF-8'); ?></td>  
-<td><?php echo htmlspecialchars($fortune, ENT_QUOTES, 'UTF-8'); ?></td>
-</tr>
-<?php } ?>
-</table>
-</body>
-</html>
+<!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>
+<?php foreach ( $arr as $id => $fortune ) : ?>
+<tr><td><?php echo $id ?></td><td><?php echo htmlspecialchars($fortune, ENT_QUOTES, 'UTF-8') ?></td></tr>
+<?php endforeach ?></table></body></html>

+ 2 - 0
frameworks/PHP/php/info.php

@@ -0,0 +1,2 @@
+<?php
+phpinfo();

+ 2 - 12
frameworks/PHP/php/json.php

@@ -1,17 +1,7 @@
 <?php
-//
-// JSON Encoding Test
-//
-
 // Set content type
-header("Content-type: application/json");
-
-// Create an array with the response string.
-$arr = array(
-    "message" => "Hello, World!"
-);
+header('Content-type: application/json');
 
 // Use the PHP standard JSON encoder.
 // http://www.php.net/manual/en/function.json-encode.php
-echo json_encode($arr);
-?>
+echo json_encode(array('message' => 'Hello, World!'));

+ 9 - 17
frameworks/PHP/php/updateraw.php

@@ -1,7 +1,5 @@
 <?php
-//
-// Database Test
-//
+header('Content-type: application/json');
 
 // Database connection
 // http://www.php.net/manual/en/ref.pdo-mysql.php
@@ -12,37 +10,31 @@ $pdo = new PDO('mysql:host=TFB-database;dbname=hello_world', 'benchmarkdbuser',
 // Read number of queries to run from URL parameter
 $query_count = 1;
 if (isset($_GET['queries']) && $_GET['queries'] > 0) {
-  $query_count = $_GET['queries'];
+  $query_count = $_GET['queries'] > 500 ? 500 : $_GET['queries'];
 }
 
 // Create an array with the response string.
 $arr = array();
-$id = mt_rand(1, 10000);
-$randomNumber = mt_rand(1, 1000);
 
 // Define query
-$statement = $pdo->prepare('SELECT randomNumber FROM World WHERE id = :id');
-$statement->bindParam(':id', $id, PDO::PARAM_INT);
-
-$updateStatement = $pdo->prepare('UPDATE World SET randomNumber = :randomNumber WHERE id = :id');
-$updateStatement->bindParam(':id', $id, PDO::PARAM_INT);
-$updateStatement->bindParam(':randomNumber', $randomNumber, PDO::PARAM_INT);
+$statement = $pdo->prepare('SELECT randomNumber FROM World WHERE id = ?');
+$updateStatement = $pdo->prepare('UPDATE World SET randomNumber = ? WHERE id = ?');
 
 // For each query, store the result set values in the response array
 while (0 < $query_count--) {
-  $statement->execute();
+  $id = mt_rand(1, 10000);
+  $randomNumber = mt_rand(1, 10000);
+
+  $statement->execute(array($id));
   
   // Store result in array.
   $world = array('id' => $id, 'randomNumber' => $statement->fetchColumn());
   $world['randomNumber'] = $randomNumber;
-  $updateStatement->execute();
+  $updateStatement->execute(array($randomNumber, $id));
   
   $arr[] = $world;
-  $id = mt_rand(1, 10000);
-  $randomNumber = mt_rand(1, 10000);
 }
 
 // Use the PHP standard JSON encoder.
 // http://www.php.net/manual/en/function.json-encode.php
 echo json_encode($arr);
-?>

+ 3 - 2
frameworks/PHP/phpixie/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;        
 
     sendfile        on;
     #tcp_nopush     on;

+ 3 - 2
frameworks/PHP/phreeze/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 3 - 2
frameworks/PHP/silex-orm/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 3 - 2
frameworks/PHP/silex/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 3 - 2
frameworks/PHP/silex/deploy/nginx_raw.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 3 - 2
frameworks/PHP/symfony/deploy/nginx.conf

@@ -1,7 +1,7 @@
-worker_processes  8;
+worker_processes  auto;
 
 events {
-    worker_connections 2048;
+    worker_connections 16384;
     multi_accept on;
     use epoll;
 }
@@ -11,6 +11,7 @@ http {
     default_type application/octet-stream;
 
     access_log off;
+    server_tokens off;
 
     sendfile on;
     tcp_nopush on;

+ 3 - 2
frameworks/PHP/yaf/deploy/nginx.conf

@@ -1,8 +1,8 @@
-worker_processes  8;
+worker_processes  auto;
 error_log stderr error;
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 http {
@@ -11,6 +11,7 @@ http {
     sendfile      on;
     keepalive_timeout  65;
     access_log off;
+    server_tokens off;
 
     upstream fastcgi_backend {
         server 127.0.0.1:9001;

+ 3 - 2
frameworks/PHP/yii2/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 http {
@@ -19,6 +19,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 3 - 2
frameworks/PHP/zend/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 3 - 2
frameworks/PHP/zend1/deploy/nginx.conf

@@ -1,5 +1,5 @@
 #user  nobody;
-worker_processes  8;
+worker_processes  auto;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
@@ -10,7 +10,7 @@ error_log stderr error;
 
 
 events {
-    worker_connections  1024;
+    worker_connections  16384;
 }
 
 
@@ -24,6 +24,7 @@ http {
 
     #access_log  logs/access.log  main;
     access_log off;
+    server_tokens off;
 
     sendfile        on;
     #tcp_nopush     on;

+ 1 - 1
toolset/setup/linux/frameworks/phalcon.sh

@@ -7,7 +7,7 @@ fw_installed phalcon && return 0
 # Enable the PHP phalcon extension
 sed -i 's|;extension=phalcon.so|extension=phalcon.so|g' $PHP_HOME/lib/php.ini
 
-VERSION="3.2.4"
+VERSION="3.3.1"
 
 fw_get -O https://github.com/phalcon/cphalcon/archive/v${VERSION}.tar.gz
 fw_untar v${VERSION}.tar.gz

+ 1 - 4
toolset/setup/linux/languages/hhvm.sh

@@ -12,10 +12,7 @@ fi
 
 fw_get http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
 
-# hhvm 3.24 causes most of our hhvm-using test implementations to segmentation
-# fault when connecting to the mysql database (the crash happens right as they
-# try to specify utf8 as the charset).  hhvm 3.21 doesn't have this problem.
-echo deb [arch=amd64] http://dl.hhvm.com/ubuntu `lsb_release -sc`-lts-3.21 main | sudo tee /etc/apt/sources.list.d/hhvm.list
+echo deb [arch=amd64] http://dl.hhvm.com/ubuntu `lsb_release -sc`-lts-3.24 main | sudo tee /etc/apt/sources.list.d/hhvm.list
 sudo apt-get update
 sudo apt-get install -y hhvm
 

+ 6 - 6
toolset/setup/linux/languages/php/php-fpm.conf

@@ -29,7 +29,7 @@
 ; in a local file.
 ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@
 ; Default Value: log/php-fpm.log
-;error_log = log/php-fpm.log
+error_log = /dev/stderr
 
 ; syslog_facility is used to specify what type of program is logging the
 ; message. This lets syslogd specify that messages from different facilities
@@ -155,7 +155,7 @@ listen = 127.0.0.1:9001
 
 ; Set listen(2) backlog.
 ; Default Value: 128 (-1 on FreeBSD and OpenBSD)
-listen.backlog = 256
+listen.backlog = 4096
 
 ; Set permissions for unix socket, if one is used. In Linux, read/write
 ; permissions must be set in order to allow connections from a web server. Many
@@ -217,22 +217,22 @@ pm = dynamic
 ; forget to tweak pm.* to fit your needs.
 ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
 ; Note: This value is mandatory.
-pm.max_children = 512
+pm.max_children = 1024
 
 ; The number of child processes created on startup.
 ; Note: Used only when pm is set to 'dynamic'
 ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
-pm.start_servers = 256
+pm.start_servers = 512
 
 ; The desired minimum number of idle server processes.
 ; Note: Used only when pm is set to 'dynamic'
 ; Note: Mandatory when pm is set to 'dynamic'
-pm.min_spare_servers = 16
+pm.min_spare_servers = 50
 
 ; The desired maximum number of idle server processes.
 ; Note: Used only when pm is set to 'dynamic'
 ; Note: Mandatory when pm is set to 'dynamic'
-pm.max_spare_servers = 256
+pm.max_spare_servers = 512
 
 ; The number of seconds after which an idle process will be killed.
 ; Note: Used only when pm is set to 'ondemand'

+ 1 - 1
toolset/setup/linux/languages/php/php7.sh

@@ -10,7 +10,7 @@ RETCODE=$(fw_exists ${IROOT}/php7.installed)
   source $IROOT/php7.installed
   return 0; }
 
-VERSION="7.2.1"
+VERSION="7.2.2"
 PHP_HOME=$IROOT/php-$VERSION
 
 rm -rf $IROOT/php7