Skip to content

Commit c4f17c6

Browse files
committed
list.sh & frameworkx-dev
- Added `frameworkx-dev` - Updated `list.sh`
1 parent 3ccb789 commit c4f17c6

File tree

9 files changed

+60
-0
lines changed

9 files changed

+60
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/*
3+
php-frameworks-bench
4+
this is a simple hello world controller to make benchmark
5+
*/
6+
namespace Controllers;
7+
8+
use React\Http\Message\Response;
9+
10+
class HelloWorldController {
11+
public function __invoke(): Response {
12+
return Response::plaintext("Hello World!");
13+
}
14+
}

frameworkx-dev/_benchmark/clean.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
rm -rf !("_benchmark"|"Controllers"|"public"|"composer.json")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
# clear cache
3+
echo -e "!"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
url="$base/$fw/public/index.php/hello/index"

frameworkx-dev/_benchmark/setup.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
composer install --no-dev -o
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
composer update

frameworkx-dev/composer.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"require": {
3+
"clue/framework-x": "dev-main"
4+
},
5+
"autoload": {
6+
"psr-4": {
7+
"Controllers\\": "Controllers/"
8+
}
9+
}
10+
}

frameworkx-dev/public/index.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
require __DIR__ . '/../vendor/autoload.php';
4+
5+
$app = new FrameworkX\App();
6+
7+
// routing in framework-x is based on fatroute
8+
// so you need to have your prefix first
9+
// https://github.com/nikic/FastRoute/issues/110#issuecomment-273760186
10+
// Strip prefix
11+
$prefix = '/php-frameworks-bench/frameworkx-dev';
12+
// I believe you should fix the prefix issue, Christian, if you care
13+
14+
// a little bit better performance via "controller instances"
15+
// instead "controller names", it's not much to consider
16+
$app->get($prefix.'/public/index.php/hello/index', new Controllers\HelloWorldController());
17+
18+
$app->run();
19+
20+
21+
/* *** php-frameworks-bench *** */
22+
require $_SERVER['DOCUMENT_ROOT'].'/php-frameworks-bench/libs/output_data.php';

list.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ cakephp-4.3
55
codeigniter-4.1
66
fastroute-1.3
77
fatfree-3.8.0
8+
frameworkx-dev
89
fuelphp-1.9
10+
laminas-2.0.x.dev
911
laravel-9.1
12+
leaf-3.0
1013
lumen-9.0
1114
phroute-2.2
1215
pure-php

0 commit comments

Comments
 (0)