diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..041b39b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,21 @@ +version: '2.1' + +jobs: + ValidateBenchmark: + docker: + - image: phpbenchmarks/benchmark-kit:4 + working_directory: /var/www/benchmark + steps: + - checkout + - run: + name: /var/entrypoint.sh + command: /var/entrypoint.sh --nginx-as-service + - run: + name: "benchmark:validate" + command: "/var/benchmark-kit/bin/console benchmark:validate:all" + +workflows: + version: '2.1' + BenchmarkKit: + jobs: + - ValidateBenchmark diff --git a/.gitignore b/.gitignore index 072705c..4fbb073 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -.idea/ -vendor/ -composer.lock +/vendor/ +/composer.lock diff --git a/.phpbenchmarks/config.yml b/.phpbenchmarks/config.yml new file mode 100644 index 0000000..95bb2fb --- /dev/null +++ b/.phpbenchmarks/config.yml @@ -0,0 +1,12 @@ +component: + id: 1 +benchmark: + type: 1 + relativeUrl: / +sourceCode: + entryPoint: public/index.php + urls: + entryPoint: 'https://github.com/phpbenchmarks/php/blob/7.2.26_hello-world_0/public/index.php' +coreDependency: + name: php + version: 7.2.26 diff --git a/.phpbenchmarks/nginx/vhost.conf b/.phpbenchmarks/nginx/vhost.conf new file mode 100644 index 0000000..d7dba5a --- /dev/null +++ b/.phpbenchmarks/nginx/vhost.conf @@ -0,0 +1,15 @@ +server { + listen ____PORT____; + server_name ____HOST____; + root ____INSTALLATION_PATH____/public; + location / { + try_files $uri /index.php$is_args$args; + } + location ~ ^/(index).php(/|$) { + fastcgi_pass unix:/run/php/____PHP_FPM_SOCK____; + fastcgi_split_path_info ^(.+.php)(/.*)$; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param HTTPS off; + } +} diff --git a/composer.lock b/.phpbenchmarks/php/7.2/composer.lock similarity index 78% rename from composer.lock rename to .phpbenchmarks/php/7.2/composer.lock index 2e05830..28dccdd 100644 --- a/composer.lock +++ b/.phpbenchmarks/php/7.2/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "02fb9e6cfd12d513c8bccf935fb4cf05", + "content-hash": "5c56b4d3dcd0a537b76583620c81b75d", "packages": [], "packages-dev": [], "aliases": [], @@ -13,7 +13,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.2" + "php": "7.2.26" }, "platform-dev": [] } diff --git a/.phpbenchmarks/php/7.2/initBenchmark.sh b/.phpbenchmarks/php/7.2/initBenchmark.sh new file mode 100755 index 0000000..f61c58a --- /dev/null +++ b/.phpbenchmarks/php/7.2/initBenchmark.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +composer install --no-dev --classmap-authoritative --ansi diff --git a/.phpbenchmarks/php/7.2/php.ini b/.phpbenchmarks/php/7.2/php.ini new file mode 100644 index 0000000..e69de29 diff --git a/.phpbenchmarks/php/7.2/preload.php b/.phpbenchmarks/php/7.2/preload.php new file mode 100644 index 0000000..feb94bc --- /dev/null +++ b/.phpbenchmarks/php/7.2/preload.php @@ -0,0 +1,6 @@ +www.phpbenchmarks.com

-## What is www.phpbenchmarks.com ? +## What is www.phpbenchmarks.com? -You will find lot of benchmarks for PHP frameworks and template engines. +You will find a lot of benchmarks for PHP and PHP libraries on [phpbenchmarks.com](http://www.phpbenchmarks.com). -You can compare results between Apache Bench and Siege, and PHP 5.6 to 7.2. +Benchmarks results are available from PHP 5.6 to latest version. -## What is this repository ? +Our benchmarking protocol is available on [benchmarking protocol page](http://www.phpbenchmarks.com/en/documentation/benchmarking-protocol). -It's benchmark common code for PHP benchmarks. +## What is this repository? -Switch branch to select your PHP major version and benchmark you want to see. +It contains PHP benchmark code. -See all PHP benchmarked versions on [phpbenchmarks/php](https://github.com/phpbenchmarks/php). +Switch branch to select version and benchmark you want to see. -You can find how we benchmark on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark-protocol.html). +You can find source code links into [Configuration::getSourceCodeUrls()](.phpbenchmarks/Configuration.php). ## Benchmarks -You can find all PHP benchmarks results on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark/php.html). +You can find PHP 7.2 benchmarks results on +[benchmarks results page](http://www.phpbenchmarks.com/en/benchmark/php/7.2). -Scores are too low ? Do not hesitate to create a pull request, and ask a new benchmark ! +See all PHP benchmarked versions on [select version page](http://www.phpbenchmarks.com/en/benchmark/php/version). + +## Community + +Go to [community page](http://www.phpbenchmarks.com/en/community) to see the Hall of fame, or download the benchmark kit to add your code! + +## How version works? + +We do not follow semantic version for this repository. + +Here is an explanation about our versioning system: + +`X.Y.Z_benchmark-slug_W` + +* `X`: PHP major version. +* `Y`: PHP minor version. +* `Z`: PHP patch version. +* `benchmark-slug`: slug of the benchmark, list available on [documentation page](http://www.phpbenchmarks.com/en/documentation). +* `W`: benchmark version diff --git a/composer.json b/composer.json index c19066e..293b423 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,6 @@ "license": "proprietary", "type": "project", "require": { - "php": "7.2.*" + "php": "7.2.26" } } diff --git a/composer.lock.php7.2 b/composer.lock.php7.2 deleted file mode 100644 index 2e05830..0000000 --- a/composer.lock.php7.2 +++ /dev/null @@ -1,19 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "02fb9e6cfd12d513c8bccf935fb4cf05", - "packages": [], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.2" - }, - "platform-dev": [] -} diff --git a/init_benchmark.sh b/init_benchmark.sh deleted file mode 100755 index 9ee4ef3..0000000 --- a/init_benchmark.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -function init() { - composer install --no-dev --classmap-authoritative - [ "$?" != "0" ] && exit 1 - - return 0 -} diff --git a/index.php b/public/index.php similarity index 50% rename from index.php rename to public/index.php index 227f831..df7fd96 100644 --- a/index.php +++ b/public/index.php @@ -3,5 +3,3 @@ declare(strict_types=1); echo 'Hello World !'; - -// require phpbenchmarks stats.php here when needed