Sfoglia il codice sorgente

PHP/cygnite + php5.6-mcrypt (#3454)

* cygnite

* travis
Nate 7 anni fa
parent
commit
73298ea1c1

+ 1 - 1
.travis.yml

@@ -122,7 +122,7 @@ env:
      - "TESTDIR=PHP/cakephp"
     # - "TESTDIR=PHP/hhvm"
     # - "TESTDIR=PHP/php"
-    # - "TESTDIR=PHP/cygnite"
+     - "TESTDIR=PHP/cygnite"
     # - "TESTDIR=PHP/codeigniter"
      - "TESTDIR=PHP/clancats"
     # - "TESTDIR=PHP/fat-free"

+ 0 - 39
frameworks/PHP/cakephp/README-cake.md

@@ -1,39 +0,0 @@
-CakePHP
-=======
-
-[![CakePHP](http://cakephp.org/img/cake-logo.png)](http://www.cakephp.org)
-
-CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.
-Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.
-
-Some Handy Links
-----------------
-
-[CakePHP](http://www.cakephp.org) - The rapid development PHP framework
-
-[Cookbook](http://book.cakephp.org) - THE Cake user documentation; start learning here!
-
-[Plugins](http://plugins.cakephp.org/) - A repository of extensions to the framework
-
-[The Bakery](http://bakery.cakephp.org) - Tips, tutorials and articles
-
-[API](http://api.cakephp.org) - A reference to Cake's classes
-
-[CakePHP TV](http://tv.cakephp.org) - Screen casts from events and video tutorials
-
-[The Cake Software Foundation](http://cakefoundation.org/) - promoting development related to CakePHP
-
-Get Support!
-------------
-
-[Our Google Group](http://groups.google.com/group/cake-php) - community mailing list and forum
-
-[#cakephp](http://webchat.freenode.net/?channels=#cakephp) on irc.freenode.net - Come chat with us, we have cake.
-
-[Q & A](http://ask.cakephp.org/) - Ask questions here, all questions welcome
-
-[Lighthouse](http://cakephp.lighthouseapp.com/) - Got issues? Please tell us!
-
-[![Bake Status](https://secure.travis-ci.org/cakephp/cakephp.png?branch=master)](http://travis-ci.org/cakephp/cakephp)
-
-![Cake Power](https://raw.github.com/cakephp/cakephp/master/lib/Cake/Console/Templates/skel/webroot/img/cake.power.gif)

+ 40 - 0
frameworks/PHP/cakephp/README.md

@@ -46,3 +46,43 @@ http://localhost/index.php/queries?queries=2
 ### Variable Update Test
 
 http://localhost/index.php/updates?queries=2
+
+CakePHP
+=======
+
+[![CakePHP](http://cakephp.org/img/cake-logo.png)](http://www.cakephp.org)
+
+CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.
+Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.
+
+Some Handy Links
+----------------
+
+[CakePHP](http://www.cakephp.org) - The rapid development PHP framework
+
+[Cookbook](http://book.cakephp.org) - THE Cake user documentation; start learning here!
+
+[Plugins](http://plugins.cakephp.org/) - A repository of extensions to the framework
+
+[The Bakery](http://bakery.cakephp.org) - Tips, tutorials and articles
+
+[API](http://api.cakephp.org) - A reference to Cake's classes
+
+[CakePHP TV](http://tv.cakephp.org) - Screen casts from events and video tutorials
+
+[The Cake Software Foundation](http://cakefoundation.org/) - promoting development related to CakePHP
+
+Get Support!
+------------
+
+[Our Google Group](http://groups.google.com/group/cake-php) - community mailing list and forum
+
+[#cakephp](http://webchat.freenode.net/?channels=#cakephp) on irc.freenode.net - Come chat with us, we have cake.
+
+[Q & A](http://ask.cakephp.org/) - Ask questions here, all questions welcome
+
+[Lighthouse](http://cakephp.lighthouseapp.com/) - Got issues? Please tell us!
+
+[![Bake Status](https://secure.travis-ci.org/cakephp/cakephp.png?branch=master)](http://travis-ci.org/cakephp/cakephp)
+
+![Cake Power](https://raw.github.com/cakephp/cakephp/master/lib/Cake/Console/Templates/skel/webroot/img/cake.power.gif)

+ 1 - 1
frameworks/PHP/cygnite/apps/configs/database.php

@@ -31,7 +31,7 @@ Configuration::initialize(
             array(
                 'db' => array(
                     'driver' => 'mysql',
-                    'host' => '127.0.0.1',
+                    'host' => 'TFB-database',
                     'port' => '',
                     'database' => 'hello_world',
                     'username' => 'benchmarkdbuser',

+ 0 - 2
frameworks/PHP/cygnite/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "cygnite",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "json_url": "/index.php/json",
       "plaintext_url": "/index.php/plaintext",
       "port": 8080,
@@ -22,7 +21,6 @@
       "versus": "php-php5"
     },
     "raw": {
-      "setup_file": "setup-mysql",
       "db_url": "/index.php/bench/db",
       "query_url": "/index.php/bench/queries/",
       "fortune_url": "/index.php/bench/fortunes",

+ 6 - 0
frameworks/PHP/cygnite/cygnite-base.dockerfile

@@ -0,0 +1,6 @@
+FROM tfb/php5:latest
+
+ADD ./ /cygnite
+WORKDIR /cygnite
+
+RUN composer.phar install --no-progress

+ 4 - 0
frameworks/PHP/cygnite/cygnite-raw.dockerfile

@@ -0,0 +1,4 @@
+FROM tfb/cygnite-base:latest
+
+CMD service php5.6-fpm start && \
+    nginx -c /cygnite/deploy/nginx.conf -g "daemon off;"

+ 4 - 0
frameworks/PHP/cygnite/cygnite.dockerfile

@@ -0,0 +1,4 @@
+FROM tfb/cygnite-base:latest
+
+CMD service php5.6-fpm start && \
+    nginx -c /cygnite/deploy/nginx.conf -g "daemon off;"

+ 27 - 98
frameworks/PHP/cygnite/deploy/nginx.conf

@@ -1,41 +1,42 @@
-#user  nobody;
+user root;
 worker_processes  auto;
 
-#error_log  logs/error.log;
-#error_log  logs/error.log  notice;
-#error_log  logs/error.log  info;
-error_log stderr error;
-
-#pid        logs/nginx.pid;
-
-
 events {
-    worker_connections  16384;
+    worker_connections 16384;
+	multi_accept on;
+	use epoll;
 }
 
-
 http {
-    include       /usr/local/nginx/conf/mime.types;
+    include       /nginx/conf/mime.types;
     default_type  application/octet-stream;
-
-    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
-    #                  '$status $body_bytes_sent "$http_referer" '
-    #                  '"$http_user_agent" "$http_x_forwarded_for"';
-
-    #access_log  logs/access.log  main;
     access_log off;
     server_tokens off;
 
-    sendfile        on;
-    #tcp_nopush     on;
+    sendfile on;
+    tcp_nopush on;
+    tcp_nodelay on;
+    keepalive_timeout 65;
 
-    #keepalive_timeout  0;
-    keepalive_timeout  65;
+    open_file_cache max=2000 inactive=20s;
+    open_file_cache_valid 60s;
+    open_file_cache_min_uses 5;
+    open_file_cache_errors off;
+
+    #FastCGI optimizations
+    fastcgi_buffers 256 16k;
+    fastcgi_buffer_size 128k;
+    fastcgi_connect_timeout 30s;
+    fastcgi_send_timeout 60s;
+    fastcgi_read_timeout 60s;
+    fastcgi_busy_buffers_size 256k;
+    fastcgi_temp_file_write_size 256k;
+    reset_timedout_connection on;
+    server_names_hash_bucket_size 100;
 
-    #gzip  on;
 
     upstream fastcgi_backend {
-        server 127.0.0.1:9001;
+        server unix:/var/run/php/php5.6-fpm.sock;
         keepalive 50;
     }
 
@@ -43,92 +44,20 @@ http {
         listen       8080;
         server_name  localhost;
 
-        #charset koi8-r;
-
-        #access_log  logs/host.access.log  main;
-
-        #location / {
-        #    root   html;
-        #    index  index.html index.htm;
-        #}
-
-        #error_page  404              /404.html;
-
-        # redirect server error pages to the static page /50x.html
-        #
-        #error_page   500 502 503 504  /50x.html;
-        #location = /50x.html {
-        #    root   html;
-        #}
-
-        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
-        #
-        #location ~ \.php$ {
-        #    proxy_pass   http://127.0.0.1;
-        #}
-
-        root /home/ubuntu/FrameworkBenchmarks/cygnite/;
+        root /cygnite/;
         index  index.php;
 
         location / {
             try_files $uri $uri/ /index.php?$uri&$args;
         }
 
-        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
-        #
         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        /usr/local/nginx/conf/fastcgi_params;
+            include        /nginx/conf/fastcgi_params;
         }
-
-        # deny access to .htaccess files, if Apache's document root
-        # concurs with nginx's one
-        #
-        #location ~ /\.ht {
-        #    deny  all;
-        #}
     }
-
-
-    # another virtual host using mix of IP-, name-, and port-based configuration
-    #
-    #server {
-    #    listen       8000;
-    #    listen       somename:8080;
-    #    server_name  somename  alias  another.alias;
-
-    #    location / {
-    #        root   html;
-    #        index  index.html index.htm;
-    #    }
-    #}
-
-
-    # HTTPS server
-    #
-    #server {
-    #    listen       443;
-    #    server_name  localhost;
-
-    #    ssl                  on;
-    #    ssl_certificate      cert.pem;
-    #    ssl_certificate_key  cert.key;
-
-    #    ssl_session_timeout  5m;
-
-    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
-    #    ssl_ciphers  HIGH:!aNULL:!MD5;
-    #    ssl_prefer_server_ciphers   on;
-
-    #    location / {
-    #        root   html;
-    #        index  index.html index.htm;
-    #    }
-    #}
-
 }

+ 0 - 5
frameworks/PHP/cygnite/setup-mysql.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql
-
-source ./setup.sh

+ 0 - 10
frameworks/PHP/cygnite/setup.sh

@@ -1,10 +0,0 @@
-#!/bin/bash
-
-fw_depends php5 nginx composer
-
-sed -i 's|127.0.0.1|'"${DBHOST}"'|g' apps/configs/database.php
-sed -i 's|root .*/FrameworkBenchmarks/cygnite|root '"${TROOT}"'|g' deploy/nginx.conf
-sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' deploy/nginx.conf
-
-php-fpm --fpm-config $FWROOT/toolset/setup/linux/languages/php/php-fpm.conf -g $TROOT/deploy/php-fpm.pid
-nginx -c ${TROOT}/deploy/nginx.conf

+ 1 - 1
toolset/setup/docker/languages/php5.dockerfile

@@ -2,7 +2,7 @@ FROM tfb/nginx:latest
 
 RUN add-apt-repository ppa:ondrej/php
 RUN apt-get update
-RUN apt-get install -y php5.6 php5.6-common php5.6-cli php5.6-fpm php5.6-mysql php5.6-xml php5.6-mbstring
+RUN apt-get install -y php5.6 php5.6-common php5.6-cli php5.6-fpm php5.6-mysql php5.6-xml php5.6-mbstring php5.6-mcrypt
 
 RUN mkdir /composer
 WORKDIR /composer