Skip to content

Commit f343eb6

Browse files
authored
Add Piko framework (#10160)
* Add the Piko framework benchmark test * Changing the display name of piko-postgres test
1 parent e3ea8e6 commit f343eb6

File tree

19 files changed

+2976
-0
lines changed

19 files changed

+2976
-0
lines changed

frameworks/PHP/piko/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.phpactor.json

frameworks/PHP/piko/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Piko Benchmarking Test
2+
3+
### Test Type Implementation Source Code
4+
5+
* [JSON](modules/site/controllers/DefaultController.php)
6+
* [PLAINTEXT](modules/site/controllers/DefaultController.php)
7+
* [DB](modules/site/controllers/DatabaseController.php)
8+
* [QUERY](modules/site/controllers/DatabaseController.php)
9+
* [UPDATE](modules/site/controllers/DatabaseController.php)
10+
* [FORTUNES](modules/site/controllers/DatabaseController.php)
11+
12+
## Important Libraries
13+
The tests were run with:
14+
* [Piko](https://piko-framework.github.io/)
15+
16+
## Test URLs
17+
### JSON
18+
19+
http://localhost:8080/json
20+
21+
### PLAINTEXT
22+
23+
http://localhost:8080/plaintext
24+
25+
### DB
26+
27+
http://localhost:8080/db
28+
29+
### QUERY
30+
31+
http://localhost:8080/query?queries=
32+
33+
### UPDATE
34+
35+
http://localhost:8080/update?queries=
36+
37+
### FORTUNES
38+
39+
http://localhost:8080/fortunes
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"framework": "piko",
3+
"tests": [
4+
{
5+
"default": {
6+
"json_url": "/json",
7+
"plaintext_url": "/plaintext",
8+
"db_url": "/db",
9+
"query_url": "/queries?queries=",
10+
"update_url": "/updates?queries=",
11+
"fortune_url": "/fortunes",
12+
"port": 8080,
13+
"approach": "Realistic",
14+
"classification": "Micro",
15+
"database": "mysql",
16+
"framework": "Piko",
17+
"language": "PHP",
18+
"flavor": "None",
19+
"orm": "Micro",
20+
"platform": "None",
21+
"webserver": "nginx",
22+
"os": "Linux",
23+
"database_os": "Linux",
24+
"display_name": "Piko Mysql",
25+
"notes": "",
26+
"versus": "None"
27+
},
28+
"postgres": {
29+
"dockerfile": "piko-postgres.dockerfile",
30+
"json_url": "/json",
31+
"plaintext_url": "/plaintext",
32+
"db_url": "/db",
33+
"query_url": "/queries?queries=",
34+
"update_url": "/updates?queries=",
35+
"fortune_url": "/fortunes",
36+
"port": 8080,
37+
"approach": "Realistic",
38+
"classification": "Micro",
39+
"database": "postgres",
40+
"framework": "Piko",
41+
"language": "PHP",
42+
"flavor": "None",
43+
"orm": "Micro",
44+
"platform": "None",
45+
"webserver": "nginx",
46+
"os": "Linux",
47+
"database_os": "Linux",
48+
"display_name": "Piko Postgres",
49+
"notes": "",
50+
"versus": "None"
51+
}
52+
}
53+
]
54+
}

frameworks/PHP/piko/composer.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "piko/project-benchmark",
3+
"description": "Application to be tested on the FrameworkBenchmarks.",
4+
"type": "project",
5+
"license": "MIT",
6+
"require": {
7+
"php": ">=8.0",
8+
"piko/framework": "^3.4",
9+
"piko/db-record": "^2.2"
10+
},
11+
"autoload": {
12+
"psr-4": {
13+
"app\\": ""
14+
}
15+
}
16+
}

frameworks/PHP/piko/config/app.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
return [
4+
'basePath' => realpath(__DIR__ . '/../'),
5+
'defaultLayoutPath' => '@app/modules/site/layouts',
6+
'defaultLayout' => 'main',
7+
'language' => 'en',
8+
'components' => [
9+
'Piko\View' => [],
10+
'Piko\Router' => [
11+
'construct' => [
12+
[
13+
'routes' => require __DIR__ . '/routes.php',
14+
]
15+
]
16+
],
17+
'PDO' => [
18+
'construct' => [
19+
(getenv('DATABASE_DRIVER') ? getenv('DATABASE_DRIVER') : 'mysql') . ':host=tfb-database;dbname=hello_world',
20+
'benchmarkdbuser',
21+
'benchmarkdbpass'
22+
]
23+
],
24+
],
25+
'modules' => [
26+
'site' => 'app\modules\site\Module'
27+
]
28+
];
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
/**
3+
* Routes definitions is a key-value paired array where
4+
* keys are request uris and values are internal routes following this format:
5+
*
6+
* '{moduleId}/{controllerId}/{actionId}'
7+
* '{moduleId}/{subModuleId}/.../{controllerId}/{actionId}'
8+
*/
9+
10+
return [
11+
'/plaintext' => 'site/default/plaintext',
12+
'/json' => 'site/default/json',
13+
'/db' => 'site/database/query',
14+
'/queries' => 'site/database/queries',
15+
'/fortunes' => 'site/database/fortunes',
16+
'/updates' => 'site/database/updates',
17+
];

0 commit comments

Comments
 (0)