-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
url="$base/$fw/public/index.php/hello/index" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
15 changes: 15 additions & 0 deletions
15
symfony-6.3/_benchmark/symfony/src/Controller/HelloWorldController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |