Skip to content

Commit 5aca1f2

Browse files
committed
REST APIbenchmark for Laravel 5.8.14
0 parents  commit 5aca1f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+9086
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.yml]
15+
indent_size = 2

.env.example

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
LOG_CHANNEL=stack
8+
9+
DB_CONNECTION=mysql
10+
DB_HOST=127.0.0.1
11+
DB_PORT=3306
12+
DB_DATABASE=homestead
13+
DB_USERNAME=homestead
14+
DB_PASSWORD=secret
15+
16+
BROADCAST_DRIVER=log
17+
CACHE_DRIVER=file
18+
QUEUE_CONNECTION=sync
19+
SESSION_DRIVER=file
20+
SESSION_LIFETIME=120
21+
22+
REDIS_HOST=127.0.0.1
23+
REDIS_PASSWORD=null
24+
REDIS_PORT=6379
25+
26+
MAIL_DRIVER=smtp
27+
MAIL_HOST=smtp.mailtrap.io
28+
MAIL_PORT=2525
29+
MAIL_USERNAME=null
30+
MAIL_PASSWORD=null
31+
MAIL_ENCRYPTION=null
32+
33+
PUSHER_APP_ID=
34+
PUSHER_APP_KEY=
35+
PUSHER_APP_SECRET=
36+
PUSHER_APP_CLUSTER=mt1
37+
38+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
39+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
composer.lock
2+
/node_modules
3+
/public/hot
4+
/public/storage
5+
/storage/*.key
6+
/vendor
7+
/.idea
8+
/.vscode
9+
/.vagrant
10+
Homestead.json
11+
Homestead.yaml
12+
npm-debug.log
13+
yarn-error.log
14+
.env
15+
.phpunit.result.cache
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace AbstractComponentConfiguration;
6+
7+
abstract class AbstractComponentConfiguration
8+
{
9+
public static function getComponentType(): int
10+
{
11+
return 2;
12+
}
13+
14+
public static function getComponentName(): string
15+
{
16+
return 'Laravel';
17+
}
18+
19+
public static function getComponentSlug(): string
20+
{
21+
return 'laravel';
22+
}
23+
24+
public static function isPhp56Enabled(): bool
25+
{
26+
return false;
27+
}
28+
29+
public static function isPhp70Enabled(): bool
30+
{
31+
return false;
32+
}
33+
34+
public static function isPhp71Enabled(): bool
35+
{
36+
return true;
37+
}
38+
39+
public static function isPhp72Enabled(): bool
40+
{
41+
return true;
42+
}
43+
44+
public static function isPhp73Enabled(): bool
45+
{
46+
return true;
47+
}
48+
49+
public static function getBenchmarkUrl(): string
50+
{
51+
return 'index.php/benchmark/rest';
52+
}
53+
54+
public static function getCoreDependencyName(): string
55+
{
56+
return 'laravel/framework';
57+
}
58+
59+
public static function getCoreDependencyMajorVersion(): int
60+
{
61+
return 5;
62+
}
63+
64+
public static function getCoreDependencyMinorVersion(): int
65+
{
66+
return 8;
67+
}
68+
69+
public static function getCoreDependencyPatchVersion(): int
70+
{
71+
return 14;
72+
}
73+
74+
public static function getBenchmarkType(): int
75+
{
76+
return 3;
77+
}
78+
79+
public static function getSourceCodeUrls(): array
80+
{
81+
return [
82+
'route' => 'https://github.com/phpbenchmarks/laravel-common/blob/laravel_5_rest-api/Http/routes.php',
83+
'controller' => 'https://github.com/phpbenchmarks/laravel-common/blob/laravel_5_rest-api/Http/Controllers/RestApiController.php',
84+
'randomizeLanguageDispatchEvent' => 'https://github.com/phpbenchmarks/laravel-common/blob/laravel_5_rest-api/Http/Controllers/RestApiController.php',
85+
'randomizeLanguageEventListener' => 'https://github.com/phpbenchmarks/laravel-common/blob/laravel_5_rest-api/Events/DefineLang.php',
86+
'translations' => 'https://github.com/phpbenchmarks/laravel-common/blob/laravel_5_rest-api/Resources/lang/en_GB/phpbenchmarks.php',
87+
'translate' => 'https://github.com/phpbenchmarks/laravel-common/blob/laravel_5_rest-api/Transformer/RestApiTransformer.php',
88+
'serialize' => 'https://github.com/phpbenchmarks/laravel-common/blob/laravel_5_rest-api/Transformer/RestApiTransformer.php'
89+
];
90+
}
91+
}

.phpbenchmarks/initBenchmark.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
function clearCache() {
6+
rm -rf bootstrap/cache/*
7+
chmod -R 777 bootstrap/cache
8+
9+
php artisan clear-compiled
10+
php artisan view:clear
11+
php artisan route:clear
12+
php artisan config:clear
13+
php artisan cache:clear
14+
15+
if [ -d "storage/framework/sessions" ]; then
16+
rm -rf storage/framework/sessions
17+
fi
18+
mkdir storage/framework/sessions
19+
}
20+
21+
pwd=$(pwd)
22+
langEn="$pwd/vendor/phpbenchmarks/laravel-common/Resources/lang/en/phpbenchmarks.php"
23+
langEnGb="$pwd/vendor/phpbenchmarks/laravel-common/Resources/lang/en_GB/phpbenchmarks.php"
24+
langFrFr="$pwd/vendor/phpbenchmarks/laravel-common/Resources/lang/fr_FR/phpbenchmarks.php"
25+
26+
if [ -L "$pwd/resources/lang/en/phpbenchmarks.php" ]; then
27+
rm "$pwd/resources/lang/en/phpbenchmarks.php"
28+
fi
29+
ln -s "$langEn" resources/lang/en/phpbenchmarks.php
30+
31+
if [ -L "$pwd/resources/lang/en_GB/phpbenchmarks.php" ]; then
32+
rm "$pwd/resources/lang/en_GB/phpbenchmarks.php"
33+
fi
34+
ln -s "$langEnGb" resources/lang/en_GB
35+
36+
if [ -L "$pwd/resources/lang/fr_FR/phpbenchmarks.php" ]; then
37+
rm "$pwd/resources/lang/fr_FR/phpbenchmarks.php"
38+
fi
39+
ln -s "$langFrFr" resources/lang/fr_FR
40+
41+
clearCache
42+
composer install --no-dev --classmap-authoritative
43+
clearCache
44+
php artisan config:cache
45+
php artisan route:cache
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]},{"id":1,"login":"phpbenchmarks","createdAt":"2017-10-30 18:03:00","translated":"aa_BB 1,000","comments":[{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}},{"id":1,"message":"http:\/\/www.php-benchmarks.com","translated":"aa_BB 2,000","type":{"id":1,"name":"Type","translated":"aa_BB 3,000"}}]}]

0 commit comments

Comments
 (0)