Skip to content

Commit

Permalink
Symfony update to v6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
joanhey committed Jul 25, 2023
1 parent 748950e commit 8e4653c
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 0 deletions.
4 changes: 4 additions & 0 deletions symfony-6.3/_benchmark/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
rm -rf !("_benchmark")
find -path './.*' -delete
rm -rf _benchmark/temp
4 changes: 4 additions & 0 deletions symfony-6.3/_benchmark/clear-cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
# clear cache
bin/console cache:clear
echo -e "done"
2 changes: 2 additions & 0 deletions symfony-6.3/_benchmark/hello_world.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
url="$base/$fw/public/index.php/hello/index"
13 changes: 13 additions & 0 deletions symfony-6.3/_benchmark/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
# create project
rm -rf _benchmark/temp
composer create-project symfony/skeleton:^6.3 ./_benchmark/temp
mv ./_benchmark/temp/{.,}* ./

# have the route & controller
yes|cp -r _benchmark/symfony/* ./

# some enhancement
composer dump-env prod
APP_ENV=prod APP_DEBUG=1 php bin/console cache:clear
composer install --no-dev --optimize-autoloader
6 changes: 6 additions & 0 deletions symfony-6.3/_benchmark/symfony/config/routes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#index:
# path: /
# controller: App\Controller\DefaultController::index
hello_world:
path: /hello/index
controller: App\Controller\HelloWorldController::index
19 changes: 19 additions & 0 deletions symfony-6.3/_benchmark/symfony/public/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/*
PHP-Frameworks-Bench
this is a simple hello world controller to make benchmark
*/
use App\Kernel;

use Symfony\Component\HttpFoundation\Request;

require __DIR__.'/../vendor/autoload.php';


$kernel = new Kernel('prod', false);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);

require $_SERVER['DOCUMENT_ROOT'].'/PHP-Frameworks-Bench/libs/output_data.php';
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php declare(strict_types=1);
/*
PHP-Frameworks-Bench
this is a simple hello world controller to make benchmark
*/
namespace App\Controller;

use Symfony\Component\HttpFoundation\Response;

// such simple controller
class HelloWorldController {
public function index(): Response {
return new Response('Hello World!');
}
}
10 changes: 10 additions & 0 deletions symfony-6.3/_benchmark/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
composer update

# have the route & controller
yes|cp -r _benchmark/symfony/* ./

# some enhancements
composer dump-env prod
composer install --no-dev --optimize-autoloader
APP_ENV=prod APP_DEBUG=1 php bin/console cache:clear

0 comments on commit 8e4653c

Please sign in to comment.