diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1e46c0d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,44 @@ +name: Test PHP benchmark +on: [ push, pull_request ] + +jobs: + setup: + name: Check PHP frameworks + runs-on: ubuntu-22.04 + + steps: + + - uses: actions/checkout@v3 + + - name: Install WRK + run: sudo apt-get install wrk w3m + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + extensions: dom, curl, libxml, mbstring, zip, pcntl, ctype, iconv, intl + coverage: none + + - name: Install Apache mod_php + run: | + LC_ALL=C.UTF-8 sudo apt-add-repository http://ppa.launchpad.net/ondrej/php/ubuntu + sudo apt install libapache2-mod-php8.2 + sudo a2enmod php8.2 rewrite + shell: bash + + - name: Setup frameworks + run: bash setup.sh + + - name: Copy files to web root + run: | + sudo mkdir /var/www/html/PHP-Frameworks-Bench + sudo cp -R ./* /var/www/html/PHP-Frameworks-Bench/ + sudo chown -R www-data:www-data /var/www/html + + - name: Restart apache server + run: sudo service apache2 restart + + - name: Check frameworks + run: bash check.sh + \ No newline at end of file diff --git a/.gitignore b/.gitignore index f932d52..5e527f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -/output/ -vendor/ -#/*/code/ +/output/* +vendor/ \ No newline at end of file diff --git a/0 b/0 new file mode 100644 index 0000000..f69d5ad --- /dev/null +++ b/0 @@ -0,0 +1 @@ +8.2.8 \ No newline at end of file diff --git a/README.md b/README.md index b3b5c63..561da9f 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # PHP Frameworks Bench -![GitHub release (latest by date)](https://img.shields.io/github/v/release/myaaghubi/PHP-Frameworks-Bench?color=purpol) ![GitHub](https://img.shields.io/github/license/myaaghubi/PHP-Frameworks-Bench?color=green) +[![Test PHP benchmark](https://github.com/myaaghubi/PHP-Frameworks-Bench/actions/workflows/test.yml/badge.svg)](https://github.com/myaaghubi/PHP-Frameworks-Bench/actions/workflows/test.yml) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/myaaghubi/PHP-Frameworks-Bench?color=purpol) ![GitHub](https://img.shields.io/github/license/myaaghubi/PHP-Frameworks-Bench?color=green) This project attempts to measure the minimum overhead (minimum bootstrap cost) of PHP frameworks in the real world. @@ -56,8 +56,6 @@ These are my benchmarks, not yours. **I encourage you to run on your (production |phroute-2.2 | 4,303.07| 44.4| 0.58| 1.4| |leaf-3.3 | 1,576.68| 16.3| 1.10| 2.6| |fatfree-3.8.1 | 1,512.30| 15.6| 1.67| 4.0| -|siler-1.7.9 | 1,416.80| 14.6| 1.17| 2.8| -|slim-3.12 | 1,061.05| 10.9| 1.40| 3.3| |slim-4.11 | 805.51| 8.3| 1.57| 3.7| |ubiquity-2.4.x.dev | 726.70| 7.5| 1.64| 3.9| |silex-2.3 | 558.07| 5.8| 2.16| 5.1| @@ -65,9 +63,9 @@ These are my benchmarks, not yours. **I encourage you to run on your (production |fuelphp-1.9 | 450.65| 4.6| 2.51| 6.0| |lumen-10.0 | 352.94| 3.6| 3.49| 8.3| |codeigniter-4.3 | 324.27| 3.3| 3.50| 8.3| -|symfony-5.4 | 319.55| 3.3| 3.82| 9.1| -|symfony-6.2 | 314.21| 3.2| 3.89| 9.2| +|symfony-5.4 | 311.74| 3.2| 3.82| 9.1| |laminas-2.0 | 309.30| 3.2| 3.50| 8.3| +|symfony-6.3 | 290.69| 3.0| 3.91| 9.3| |cakephp-4.4 | 262.25| 2.7| 4.49| 10.7| |laravel-10.0 | 96.97| 1.0| 11.99| 28.5| @@ -181,7 +179,6 @@ For frameworks, I considered the official repos: * [CodeIgniter](https://github.com/codeigniter4/CodeIgniter4) * [FastRoute](https://github.com/nikic/FastRoute) * [FatFree](https://github.com/bcosca/fatfree) -* [FrameworkX](https://github.com/clue/framework-x) * [FuelPHP](https://github.com/fuelphp/fuelphp) * [KumbiaPHP](https://github.com/KumbiaPHP/KumbiaPHP) * [Laminas](https://github.com/laminas) @@ -189,7 +186,6 @@ For frameworks, I considered the official repos: * [Leaf](https://github.com/leafsphp/leaf) * [Lumen](https://github.com/laravel/lumen) * [PhRoute](https://github.com/mrjgreen/phroute) -* [Siler](https://github.com/leocavalcante/siler) * [Silex](https://github.com/silexphp/Silex) * [Slim](https://github.com/slimphp/Slim) * [Symfony](https://github.com/symfony/symfony) diff --git a/base/_functions.sh b/base/_functions.sh index 84f1270..584bb52 100755 --- a/base/_functions.sh +++ b/base/_functions.sh @@ -8,7 +8,7 @@ benchmark () { url_status=$(bash check.sh -t "$fw") # find 'done' - status=${url_status%%done*} + status=${url_status%%✔ ${fw}*} # if the index of 'done' be equal to # the length of the url_status then @@ -90,6 +90,4 @@ benchmark () { fi echo "$url" >> "$url_file" - - echo } diff --git a/base/hello_world.sh b/base/hello_world.sh index 893a370..a0dcc09 100755 --- a/base/hello_world.sh +++ b/base/hello_world.sh @@ -33,14 +33,14 @@ if [ -f "$url_file" ]; then mv "$url_file" "$url_file.old" fi - -phpv=`php -r 'echo phpversion();'` -echo "/------- PHP $phpv -------/" +phpc=`curl -s "$base/libs/php_config.php"` +echo "/------- PHP Config -------/" +echo "$phpc" for fw in `echo $param_targets` do if [ -d "$fw" ]; then - echo "/------- $fw -------/" + echo "\n/------- $fw -------/" # read -p "Continue to $fw (y/n)?" choice # case "$choice" in @@ -54,7 +54,7 @@ do if [ "$param_clean" = true ]; then bash clean.sh - bash setup.sh "$fw" + bash setup.sh -t "$fw" fi # read -p "Continue to benchmark (y/n)?" choice @@ -67,7 +67,8 @@ do # fi # reset the opcache - php ./libs/reset_opcache.php + opcacherest=`curl -s "$base/libs/reset_opcache.php"` + echo "$opcacherest" if [ "$param_restart_apache" = true ]; then echo 'systemctl restart apache2' diff --git a/benchmark.config b/benchmark.config index b4c8c55..ddbc64a 100644 --- a/benchmark.config +++ b/benchmark.config @@ -20,21 +20,18 @@ cakephp-4.4 codeigniter-4.3 fastroute-1.3 fatfree-3.8.1 -frameworkx-dev fuelphp-1.9 -kumbiaphp-1.1 +kumbia-1.1 laminas-2.0 laravel-10.0 leaf-3.3 lumen-10.0 phroute-2.2 pure-php -siler-1.7.9 silex-2.3 -slim-3.12 slim-4.11 symfony-5.4 -symfony-6.2 +symfony-6.3 ubiquity-2.4.x.dev yii-2.0-basic -" \ No newline at end of file +" diff --git a/benchmark.sh b/benchmark.sh index a502f15..533eb19 100644 --- a/benchmark.sh +++ b/benchmark.sh @@ -81,4 +81,5 @@ done sh ./base/hello_world.sh +echo '' php ./libs/show_results_table.php \ No newline at end of file diff --git a/check.sh b/check.sh index 720e855..324ccb3 100755 --- a/check.sh +++ b/check.sh @@ -3,20 +3,36 @@ . ./benchmark.config . ./base/option_target.sh +# Colors +GREEN='\033[0;32m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +FAIL=0 + for fw in `echo $param_targets` do if [ -d "$fw" ]; then - echo -n "/------- $fw: checking... " . "$fw/_benchmark/hello_world.sh" url_output=$(curl -s "$url") # expected to get the Hello World! + libs/output_data.php if ! [[ "$url_output" =~ ^('Hello World!')(.*)(([0-9]*):(([0-9]+([.][0-9]*)?|[.][0-9]+)):([0-9]*))$ ]]; then - echo -e "error: \n$url" - echo "$url_output" + echo -e "${RED}❌ $fw ${NC}" + echo "$url" + + if [ -x "$(command -v w3m)" ]; then + echo "$url_output" | w3m -dump -T text/html + else + echo "$url_output" + fi + + FAIL=1 else - echo "done." + printf "%-34b %4s bytes %s\n" "${GREEN}✔ $fw ${NC}" "${#url_output}" "$url" fi fi -done \ No newline at end of file +done + +exit $FAIL \ No newline at end of file diff --git a/codeigniter-4.3/_benchmark/clear-cache.sh b/codeigniter-4.3/_benchmark/clear-cache.sh index 7abcc10..f8cc8a8 100755 --- a/codeigniter-4.3/_benchmark/clear-cache.sh +++ b/codeigniter-4.3/_benchmark/clear-cache.sh @@ -1,4 +1,4 @@ #!/bin/sh # clear cache -sudo rm -rf writable/cache/* +rm -rf writable/cache/* echo -e "done" \ No newline at end of file diff --git a/codeigniter-4.3/_benchmark/setup.sh b/codeigniter-4.3/_benchmark/setup.sh index db2499f..4a9520a 100755 --- a/codeigniter-4.3/_benchmark/setup.sh +++ b/codeigniter-4.3/_benchmark/setup.sh @@ -9,5 +9,5 @@ yes|cp -r _benchmark/codeigniter/* ./ # some enhancements composer install --no-dev -o -sudo chown -Rv www-data writable +chmod -R o+w writable rm ./public/.htaccess \ No newline at end of file diff --git a/codeigniter-4.3/_benchmark/update.sh b/codeigniter-4.3/_benchmark/update.sh index e9eebfa..85fa374 100755 --- a/codeigniter-4.3/_benchmark/update.sh +++ b/codeigniter-4.3/_benchmark/update.sh @@ -6,5 +6,5 @@ yes|cp -r _benchmark/codeigniter/* ./ # some enhancements composer install --no-dev -o -sudo chown -Rv www-data writable +chmod -R o+w writable rm ./public/.htaccess \ No newline at end of file diff --git a/fastroute-1.3/_benchmark/clean.sh b/fastroute-1.3/_benchmark/clean.sh index 319312b..5d2acfa 100644 --- a/fastroute-1.3/_benchmark/clean.sh +++ b/fastroute-1.3/_benchmark/clean.sh @@ -1,3 +1,3 @@ #!/bin/sh -rm -rf !("_benchmark"|"Controllers"|"composer.json"|"index.php") +rm -rf !("_benchmark"|"Controllers"|"composer.json"|"public") find -path './.*' -delete \ No newline at end of file diff --git a/fastroute-1.3/_benchmark/hello_world.sh b/fastroute-1.3/_benchmark/hello_world.sh index 9cd8d63..2d69368 100644 --- a/fastroute-1.3/_benchmark/hello_world.sh +++ b/fastroute-1.3/_benchmark/hello_world.sh @@ -1,2 +1,2 @@ #!/bin/sh -url="$base/$fw/index.php/hello/index" \ No newline at end of file +url="$base/$fw/public/index.php/hello/index" \ No newline at end of file diff --git a/fastroute-1.3/index.php b/fastroute-1.3/public/index.php similarity index 93% rename from fastroute-1.3/index.php rename to fastroute-1.3/public/index.php index 2814d3c..a756173 100644 --- a/fastroute-1.3/index.php +++ b/fastroute-1.3/public/index.php @@ -3,7 +3,7 @@ // https://github.com/nikic/FastRoute#usage // Here's a basic usage example: -require __DIR__.'/vendor/autoload.php'; +require __DIR__.'/../vendor/autoload.php'; $dispatcher = FastRoute\simpleDispatcher(function(FastRoute\RouteCollector $r) { @@ -22,7 +22,7 @@ // https://github.com/nikic/FastRoute/issues/110#issuecomment-273760186 // Strip prefix -$prefix = '/PHP-Frameworks-Bench/fastroute-1.3'; +$prefix = '/PHP-Frameworks-Bench/fastroute-1.3/public'; if ($prefix !== '' && strpos($uri, $prefix) === 0) { $uri = substr($uri, strlen($prefix)); } diff --git a/fatfree-3.8.1/_benchmark/clean.sh b/fatfree-3.8.1/_benchmark/clean.sh index 319312b..5d2acfa 100644 --- a/fatfree-3.8.1/_benchmark/clean.sh +++ b/fatfree-3.8.1/_benchmark/clean.sh @@ -1,3 +1,3 @@ #!/bin/sh -rm -rf !("_benchmark"|"Controllers"|"composer.json"|"index.php") +rm -rf !("_benchmark"|"Controllers"|"composer.json"|"public") find -path './.*' -delete \ No newline at end of file diff --git a/fatfree-3.8.1/_benchmark/hello_world.sh b/fatfree-3.8.1/_benchmark/hello_world.sh index 9cd8d63..2d69368 100644 --- a/fatfree-3.8.1/_benchmark/hello_world.sh +++ b/fatfree-3.8.1/_benchmark/hello_world.sh @@ -1,2 +1,2 @@ #!/bin/sh -url="$base/$fw/index.php/hello/index" \ No newline at end of file +url="$base/$fw/public/index.php/hello/index" \ No newline at end of file diff --git a/fatfree-3.8.1/index.php b/fatfree-3.8.1/public/index.php similarity index 86% rename from fatfree-3.8.1/index.php rename to fatfree-3.8.1/public/index.php index 8c220c5..7d91d7b 100755 --- a/fatfree-3.8.1/index.php +++ b/fatfree-3.8.1/public/index.php @@ -1,6 +1,6 @@ get($prefix.'/public/index.php/hello/index', new Controllers\HelloWorldController()); - -$app->run(); - - -/* *** PHP-Frameworks-Bench *** */ -require $_SERVER['DOCUMENT_ROOT'].'/PHP-Frameworks-Bench/libs/output_data.php'; \ No newline at end of file diff --git a/fuelphp-1.9/_benchmark/fuel/fuel/app/logs/.gitkeep b/fuelphp-1.9/_benchmark/fuel/fuel/app/logs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/kumbiaphp-1.1/_benchmark/clean.sh b/kumbia-1.1/_benchmark/clean.sh similarity index 100% rename from kumbiaphp-1.1/_benchmark/clean.sh rename to kumbia-1.1/_benchmark/clean.sh diff --git a/frameworkx-dev/_benchmark/clear-cache.sh b/kumbia-1.1/_benchmark/clear-cache.sh similarity index 100% rename from frameworkx-dev/_benchmark/clear-cache.sh rename to kumbia-1.1/_benchmark/clear-cache.sh diff --git a/kumbiaphp-1.1/_benchmark/hello_world.sh b/kumbia-1.1/_benchmark/hello_world.sh similarity index 100% rename from kumbiaphp-1.1/_benchmark/hello_world.sh rename to kumbia-1.1/_benchmark/hello_world.sh diff --git a/kumbiaphp-1.1/_benchmark/kumbia/default/app/controllers/helloworld_controller.php b/kumbia-1.1/_benchmark/kumbia/default/app/controllers/helloworld_controller.php similarity index 100% rename from kumbiaphp-1.1/_benchmark/kumbia/default/app/controllers/helloworld_controller.php rename to kumbia-1.1/_benchmark/kumbia/default/app/controllers/helloworld_controller.php diff --git a/kumbiaphp-1.1/_benchmark/kumbia/default/public/index.php b/kumbia-1.1/_benchmark/kumbia/default/public/index.php similarity index 100% rename from kumbiaphp-1.1/_benchmark/kumbia/default/public/index.php rename to kumbia-1.1/_benchmark/kumbia/default/public/index.php diff --git a/kumbiaphp-1.1/_benchmark/setup.sh b/kumbia-1.1/_benchmark/setup.sh similarity index 100% rename from kumbiaphp-1.1/_benchmark/setup.sh rename to kumbia-1.1/_benchmark/setup.sh diff --git a/kumbiaphp-1.1/_benchmark/update.sh b/kumbia-1.1/_benchmark/update.sh similarity index 100% rename from kumbiaphp-1.1/_benchmark/update.sh rename to kumbia-1.1/_benchmark/update.sh diff --git a/kumbiaphp-1.1/_benchmark/clear-cache.sh b/kumbiaphp-1.1/_benchmark/clear-cache.sh deleted file mode 100755 index e629bde..0000000 --- a/kumbiaphp-1.1/_benchmark/clear-cache.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -# clear cache -echo -e "!" \ No newline at end of file diff --git a/laminas-2.0/_benchmark/clear-cache.sh b/laminas-2.0/_benchmark/clear-cache.sh index c8b0083..a03bab3 100755 --- a/laminas-2.0/_benchmark/clear-cache.sh +++ b/laminas-2.0/_benchmark/clear-cache.sh @@ -1,4 +1,4 @@ #!/bin/sh # clear cache -sudo rm -rf data/cache/* +rm -rf data/cache/* echo -e "done" \ No newline at end of file diff --git a/laminas-2.0/_benchmark/setup.sh b/laminas-2.0/_benchmark/setup.sh index 27b40f8..f88b3d0 100755 --- a/laminas-2.0/_benchmark/setup.sh +++ b/laminas-2.0/_benchmark/setup.sh @@ -9,4 +9,5 @@ yes|cp -rf _benchmark/laminas/. ./ # some enhancements composer install --optimize-autoloader --no-dev +chmod -R o+w data/cache rm ./public/.htaccess \ No newline at end of file diff --git a/laminas-2.0/_benchmark/update.sh b/laminas-2.0/_benchmark/update.sh index 9e36f3a..0faa963 100755 --- a/laminas-2.0/_benchmark/update.sh +++ b/laminas-2.0/_benchmark/update.sh @@ -6,4 +6,5 @@ yes|cp -rf _benchmark/laminas/. ./ # some enhancements composer install --optimize-autoloader --no-dev +chmod -R o+w data/cache rm ./public/.htaccess \ No newline at end of file diff --git a/laravel-10.0/_benchmark/setup.sh b/laravel-10.0/_benchmark/setup.sh index 9e4f893..2c9860b 100755 --- a/laravel-10.0/_benchmark/setup.sh +++ b/laravel-10.0/_benchmark/setup.sh @@ -9,7 +9,6 @@ yes|cp -rf _benchmark/laravel/. ./ # some enhancements composer install --optimize-autoloader --no-dev -chmod o+w storage/* -sudo chmod o+w storage/framework/* -php artisan optimize +chmod -R o+w storage + rm ./public/.htaccess \ No newline at end of file diff --git a/laravel-10.0/_benchmark/update.sh b/laravel-10.0/_benchmark/update.sh index a4d0562..ad07416 100755 --- a/laravel-10.0/_benchmark/update.sh +++ b/laravel-10.0/_benchmark/update.sh @@ -6,7 +6,6 @@ yes|cp -rf _benchmark/laravel/. ./ # some enhancements composer install --optimize-autoloader --no-dev -chmod o+w storage/* -sudo chmod o+w storage/framework/* -php artisan optimize +chmod -R o+w storage + rm ./public/.htaccess \ No newline at end of file diff --git a/leaf-3.3/_benchmark/clean.sh b/leaf-3.3/_benchmark/clean.sh index 319312b..5d2acfa 100755 --- a/leaf-3.3/_benchmark/clean.sh +++ b/leaf-3.3/_benchmark/clean.sh @@ -1,3 +1,3 @@ #!/bin/sh -rm -rf !("_benchmark"|"Controllers"|"composer.json"|"index.php") +rm -rf !("_benchmark"|"Controllers"|"composer.json"|"public") find -path './.*' -delete \ No newline at end of file diff --git a/leaf-3.3/_benchmark/hello_world.sh b/leaf-3.3/_benchmark/hello_world.sh index 9cd8d63..2d69368 100755 --- a/leaf-3.3/_benchmark/hello_world.sh +++ b/leaf-3.3/_benchmark/hello_world.sh @@ -1,2 +1,2 @@ #!/bin/sh -url="$base/$fw/index.php/hello/index" \ No newline at end of file +url="$base/$fw/public/index.php/hello/index" \ No newline at end of file diff --git a/leaf-3.3/index.php b/leaf-3.3/public/index.php similarity index 84% rename from leaf-3.3/index.php rename to leaf-3.3/public/index.php index 2b1a9fd..7d0f006 100755 --- a/leaf-3.3/index.php +++ b/leaf-3.3/public/index.php @@ -1,6 +1,6 @@ get("/index.php/hello/index", 'Controllers\HelloWorldController@index'); diff --git a/libs/app.js b/libs/app.js index 203b6aa..2feb501 100644 --- a/libs/app.js +++ b/libs/app.js @@ -1,4 +1,8 @@ -const COLORS = [ +/* + PHP-Frameworks-Bench + */ + +const COLORS_ = [ "#3273a8", "#3a78ac", "#437cae", @@ -21,10 +25,19 @@ const COLORS = [ "#a87732", ]; -var rpsChart = document.getElementById('rpsChart'); -var memoryChart = document.getElementById('memoryChart'); -var timeChart = document.getElementById('timeChart'); -var fileChart = document.getElementById('fileChart'); +// For more colors +// I'm lazy to regenerate them again +// so lets have a map to make more +let COLORS = dataRPS.map( + (item, index) => + COLORS_[Math.round(index / (dataRPS.length / COLORS_.length))] +); + +var rpsChart = document.getElementById("rpsChart"); +var memoryChart = document.getElementById("memoryChart"); +var timeChart = document.getElementById("timeChart"); +var fileChart = document.getElementById("fileChart"); + new Chart(rpsChart, { type: "bar", data: { diff --git a/libs/output_data.php b/libs/output_data.php index 5c12ec2..452f3ad 100644 --- a/libs/output_data.php +++ b/libs/output_data.php @@ -1,7 +1,7 @@ getBody()->write("Hello World!"); - return $response; - } -} diff --git a/slim-3.12/_benchmark/clean.sh b/slim-3.12/_benchmark/clean.sh deleted file mode 100644 index 319312b..0000000 --- a/slim-3.12/_benchmark/clean.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -rm -rf !("_benchmark"|"Controllers"|"composer.json"|"index.php") -find -path './.*' -delete \ No newline at end of file diff --git a/slim-3.12/_benchmark/clear-cache.sh b/slim-3.12/_benchmark/clear-cache.sh deleted file mode 100755 index e629bde..0000000 --- a/slim-3.12/_benchmark/clear-cache.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -# clear cache -echo -e "!" \ No newline at end of file diff --git a/slim-3.12/_benchmark/hello_world.sh b/slim-3.12/_benchmark/hello_world.sh deleted file mode 100755 index 9cd8d63..0000000 --- a/slim-3.12/_benchmark/hello_world.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -url="$base/$fw/index.php/hello/index" \ No newline at end of file diff --git a/slim-3.12/_benchmark/setup.sh b/slim-3.12/_benchmark/setup.sh deleted file mode 100755 index 1d7495c..0000000 --- a/slim-3.12/_benchmark/setup.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -composer install --no-dev -o \ No newline at end of file diff --git a/slim-3.12/_benchmark/update.sh b/slim-3.12/_benchmark/update.sh deleted file mode 100644 index 98986ff..0000000 --- a/slim-3.12/_benchmark/update.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -composer update \ No newline at end of file diff --git a/slim-3.12/composer.json b/slim-3.12/composer.json deleted file mode 100755 index 3a06494..0000000 --- a/slim-3.12/composer.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "require": { - "slim/slim": "^3.12" - }, - "config": { - "optimize-autoloader": true - }, - "autoload": { - "psr-4": { - "Controllers\\": "Controllers/" - } - } -} diff --git a/slim-3.12/index.php b/slim-3.12/index.php deleted file mode 100755 index 0dd94f4..0000000 --- a/slim-3.12/index.php +++ /dev/null @@ -1,15 +0,0 @@ -getContainer(); - -/* *** PHP-Frameworks-Bench *** */ -$app->get('/hello/index', Controllers\HelloWorldController::class . ':index'); - -$app->run(); - -/* *** PHP-Frameworks-Bench *** */ -require $_SERVER['DOCUMENT_ROOT'].'/PHP-Frameworks-Bench/libs/output_data.php'; \ No newline at end of file diff --git a/slim-4.11/_benchmark/clean.sh b/slim-4.11/_benchmark/clean.sh index 319312b..5d2acfa 100644 --- a/slim-4.11/_benchmark/clean.sh +++ b/slim-4.11/_benchmark/clean.sh @@ -1,3 +1,3 @@ #!/bin/sh -rm -rf !("_benchmark"|"Controllers"|"composer.json"|"index.php") +rm -rf !("_benchmark"|"Controllers"|"composer.json"|"public") find -path './.*' -delete \ No newline at end of file diff --git a/slim-4.11/_benchmark/hello_world.sh b/slim-4.11/_benchmark/hello_world.sh index 9cd8d63..2d69368 100644 --- a/slim-4.11/_benchmark/hello_world.sh +++ b/slim-4.11/_benchmark/hello_world.sh @@ -1,2 +1,2 @@ #!/bin/sh -url="$base/$fw/index.php/hello/index" \ No newline at end of file +url="$base/$fw/public/index.php/hello/index" \ No newline at end of file diff --git a/slim-4.11/index.php b/slim-4.11/public/index.php similarity index 78% rename from slim-4.11/index.php rename to slim-4.11/public/index.php index 4770eb4..5338601 100644 --- a/slim-4.11/index.php +++ b/slim-4.11/public/index.php @@ -1,13 +1,13 @@ setBasePath("/PHP-Frameworks-Bench/slim-4.11/index.php"); +$app->setBasePath("/PHP-Frameworks-Bench/slim-4.11/public/index.php"); // Add error middleware $app->addErrorMiddleware(false, true, true); diff --git a/symfony-5.4/_benchmark/clear-cache.sh b/symfony-5.4/_benchmark/clear-cache.sh index 3ebcec0..fbdb14f 100755 --- a/symfony-5.4/_benchmark/clear-cache.sh +++ b/symfony-5.4/_benchmark/clear-cache.sh @@ -1,4 +1,4 @@ #!/bin/sh # clear cache -bin/console cache:clear +bin/console cache:clear -q echo -e "done" \ No newline at end of file diff --git a/symfony-5.4/_benchmark/setup.sh b/symfony-5.4/_benchmark/setup.sh index 916ef41..efac397 100755 --- a/symfony-5.4/_benchmark/setup.sh +++ b/symfony-5.4/_benchmark/setup.sh @@ -9,5 +9,6 @@ yes|cp -r _benchmark/symfony/* ./ # some enhancements composer dump-env prod -APP_ENV=prod APP_DEBUG=0 php bin/console cache:clear -composer install --no-dev --optimize-autoloader \ No newline at end of file +APP_ENV=prod APP_DEBUG=0 bin/console cache:clear +composer install --no-dev --optimize-autoloader +chmod -R o+w var \ No newline at end of file diff --git a/symfony-5.4/_benchmark/update.sh b/symfony-5.4/_benchmark/update.sh index 1898218..4145885 100755 --- a/symfony-5.4/_benchmark/update.sh +++ b/symfony-5.4/_benchmark/update.sh @@ -7,5 +7,6 @@ yes|cp -r _benchmark/symfony/* ./ # some enhancements composer dump-env prod composer install --no-dev --optimize-autoloader -APP_ENV=prod APP_DEBUG=0 php bin/console cache:clear +APP_ENV=prod APP_DEBUG=0 bin/console cache:clear +chmod -R o+w var rm ./public/.htaccess \ No newline at end of file diff --git a/symfony-6.2/_benchmark/hello_world.sh b/symfony-6.2/_benchmark/hello_world.sh deleted file mode 100644 index 2d69368..0000000 --- a/symfony-6.2/_benchmark/hello_world.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -url="$base/$fw/public/index.php/hello/index" \ No newline at end of file diff --git a/symfony-6.2/_benchmark/clean.sh b/symfony-6.3/_benchmark/clean.sh similarity index 100% rename from symfony-6.2/_benchmark/clean.sh rename to symfony-6.3/_benchmark/clean.sh diff --git a/symfony-6.2/_benchmark/clear-cache.sh b/symfony-6.3/_benchmark/clear-cache.sh similarity index 58% rename from symfony-6.2/_benchmark/clear-cache.sh rename to symfony-6.3/_benchmark/clear-cache.sh index 3ebcec0..fbdb14f 100755 --- a/symfony-6.2/_benchmark/clear-cache.sh +++ b/symfony-6.3/_benchmark/clear-cache.sh @@ -1,4 +1,4 @@ #!/bin/sh # clear cache -bin/console cache:clear +bin/console cache:clear -q echo -e "done" \ No newline at end of file diff --git a/frameworkx-dev/_benchmark/hello_world.sh b/symfony-6.3/_benchmark/hello_world.sh old mode 100755 new mode 100644 similarity index 100% rename from frameworkx-dev/_benchmark/hello_world.sh rename to symfony-6.3/_benchmark/hello_world.sh diff --git a/symfony-6.2/_benchmark/setup.sh b/symfony-6.3/_benchmark/setup.sh similarity index 51% rename from symfony-6.2/_benchmark/setup.sh rename to symfony-6.3/_benchmark/setup.sh index 66a9036..571335b 100755 --- a/symfony-6.2/_benchmark/setup.sh +++ b/symfony-6.3/_benchmark/setup.sh @@ -1,7 +1,7 @@ #!/bin/sh # create project rm -rf _benchmark/temp -composer create-project symfony/skeleton:^6.2 ./_benchmark/temp +composer create-project symfony/skeleton:^6.3 ./_benchmark/temp mv ./_benchmark/temp/{.,}* ./ # have the route & controller @@ -9,5 +9,6 @@ yes|cp -r _benchmark/symfony/* ./ # some enhancement composer dump-env prod -APP_ENV=prod APP_DEBUG=0 php bin/console cache:clear -composer install --no-dev --optimize-autoloader \ No newline at end of file +APP_ENV=prod APP_DEBUG=0 bin/console cache:clear +composer install --no-dev --optimize-autoloader +chmod -R o+w var \ No newline at end of file diff --git a/symfony-6.2/_benchmark/symfony/config/routes.yaml b/symfony-6.3/_benchmark/symfony/config/routes.yaml similarity index 100% rename from symfony-6.2/_benchmark/symfony/config/routes.yaml rename to symfony-6.3/_benchmark/symfony/config/routes.yaml diff --git a/symfony-6.2/_benchmark/symfony/public/index.php b/symfony-6.3/_benchmark/symfony/public/index.php similarity index 100% rename from symfony-6.2/_benchmark/symfony/public/index.php rename to symfony-6.3/_benchmark/symfony/public/index.php diff --git a/symfony-6.2/_benchmark/symfony/src/Controller/HelloWorldController.php b/symfony-6.3/_benchmark/symfony/src/Controller/HelloWorldController.php similarity index 100% rename from symfony-6.2/_benchmark/symfony/src/Controller/HelloWorldController.php rename to symfony-6.3/_benchmark/symfony/src/Controller/HelloWorldController.php diff --git a/symfony-6.2/_benchmark/update.sh b/symfony-6.3/_benchmark/update.sh similarity index 73% rename from symfony-6.2/_benchmark/update.sh rename to symfony-6.3/_benchmark/update.sh index fc2c7cf..ada674d 100644 --- a/symfony-6.2/_benchmark/update.sh +++ b/symfony-6.3/_benchmark/update.sh @@ -7,4 +7,5 @@ yes|cp -r _benchmark/symfony/* ./ # some enhancements composer dump-env prod composer install --no-dev --optimize-autoloader -APP_ENV=prod APP_DEBUG=0 php bin/console cache:clear \ No newline at end of file +APP_ENV=prod APP_DEBUG=0 bin/console cache:clear +chmod -R o+w var \ No newline at end of file