Skip to content

Commit d833c88

Browse files
committed
Create restapi branch
1 parent c9dfe9d commit d833c88

18 files changed

+155
-3515
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ You will not find final source code here, as it's in [phpbenchmarks/symfony](htt
1818

1919
You can find how we benchmark it [here](http://www.phpbenchmarks.com/en/benchmark-protocol).
2020

21-
## Symfony 3.2.13: 18,096
22-
23-
Benchmark | PHP | Request | Rq/sec | Score
24-
--------- | --- | ------- | ------ | -----
25-
[Hello World](http://www.phpbenchmarks.com/en/benchmark/apache-bench/php-7.2/symfony-3.2.html#benchmark-hello-world) | 7.2 | 1.6 ms | 638 | 11,957
26-
[Rest API](http://www.phpbenchmarks.com/en/benchmark/apache-bench/php-7.2/symfony-3.2.html#benchmark-rest) | 7.2 | 2.6 ms | 388 | 6,139
21+
Each benchmark type have their own branch :
22+
[Hello World](https://github.com/phpbenchmarks/symfony-3-2/tree/helloworld),
23+
[Blog](https://github.com/phpbenchmarks/symfony-3-2/tree/blog),
24+
[REST Api](https://github.com/phpbenchmarks/symfony-3-2/tree/restapi),
25+
[Small overload](https://github.com/phpbenchmarks/symfony-3-2/tree/smalloverload)
26+
and [Big overload](https://github.com/phpbenchmarks/symfony-3-2/tree/bigoverload).
2727

2828
[See all benchmark results](http://www.phpbenchmarks.com/en/benchmark/apache-bench/php-7.2/symfony-3.2.html)
2929

app/AppKernel.php

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,14 @@
55

66
class AppKernel extends Kernel
77
{
8-
/** @var string[] */
9-
protected $bundleClasses;
10-
11-
/**
12-
* @param string $environment
13-
* @param bool $debug
14-
* @param string[] $bundleClasses
15-
*/
16-
public function __construct($environment, $debug, array $bundleClasses = [])
17-
{
18-
parent::__construct($environment, $debug);
19-
20-
$this->bundleClasses = $bundleClasses;
21-
}
22-
238
public function registerBundles()
249
{
25-
$bundles = array(
10+
return[
2611
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
2712
new Symfony\Bundle\TwigBundle\TwigBundle(),
2813
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
29-
);
30-
foreach ($this->bundleClasses as $bundleClass) {
31-
$bundles[] = new $bundleClass();
32-
}
33-
34-
return $bundles;
14+
new PhpBenchmarksSymfony\Bundle\RestBundle\RestBundle()
15+
];
3516
}
3617

3718
public function getRootDir()
@@ -51,6 +32,6 @@ public function getLogDir()
5132

5233
public function registerContainerConfiguration(LoaderInterface $loader)
5334
{
54-
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
35+
$loader->load($this->getRootDir() . '/config/config.yml');
5536
}
5637
}

app/config/config.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ parameters:
77
framework:
88
secret: '%secret%'
99
router:
10-
resource: '%kernel.root_dir%/config/routing.yml'
10+
resource: "@RestBundle/Resources/config/routing.yml"
1111
strict_requirements: ~
1212
form: ~
1313
csrf_protection: ~
@@ -25,3 +25,7 @@ framework:
2525
assets: ~
2626
php_errors:
2727
log: false
28+
serializer:
29+
enabled: true
30+
translator:
31+
enabled: true

app/config/config_helloworld.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/config/config_rest.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

app/config/parameters.yml.dist

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
parameters:
2-
database_host: 127.0.0.1
3-
database_port: ~
4-
database_name: symfony
5-
database_user: root
6-
database_password: ~
72
secret: ThisTokenIsNotSoSecretChangeIt

app/config/security.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
1-
# To get started with security, check out the documentation:
2-
# https://symfony.com/doc/current/security.html
31
security:
4-
5-
# https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
62
providers:
73
in_memory:
84
memory: ~
95

106
firewalls:
11-
# disables authentication for assets and the profiler, adapt it according to your needs
127
dev:
138
pattern: ^/(_(profiler|wdt)|css|images|js)/
149
security: false
1510

1611
main:
1712
anonymous: ~
18-
# activate different ways to authenticate
19-
20-
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
21-
#http_basic: ~
22-
23-
# https://symfony.com/doc/current/security/form_login_setup.html
24-
#form_login: ~

bin/console

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ set_time_limit(0);
1515
require __DIR__.'/../app/autoload.php';
1616

1717
$input = new ArgvInput();
18-
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
19-
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';
20-
21-
if ($debug) {
22-
Debug::enable();
23-
}
24-
25-
$kernel = new AppKernel($env, $debug);
18+
$kernel = new AppKernel('prod', false);
2619
$application = new Application($kernel);
2720
$application->run($input);

composer.json

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,20 @@
33
"license": "proprietary",
44
"type": "project",
55
"autoload": {
6-
"psr-4": {
7-
"": "src/"
8-
},
96
"classmap": [
107
"app/AppKernel.php",
118
"app/AppCache.php"
129
]
1310
},
1411
"require": {
1512
"php": ">=5.5.9",
16-
"doctrine/doctrine-bundle": "^1.6",
17-
"doctrine/doctrine-cache-bundle": "^1.2",
18-
"doctrine/orm": "^2.5",
1913
"incenteev/composer-parameter-handler": "^2.0",
2014
"sensio/distribution-bundle": "^5.0",
2115
"sensio/framework-extra-bundle": "^3.0.2",
22-
"symfony/monolog-bundle": "^3.0.2",
2316
"symfony/polyfill-apcu": "^1.0",
24-
"symfony/swiftmailer-bundle": "^2.3.10",
2517
"symfony/symfony": "3.2.*",
26-
"twig/twig": "^1.0||^2.0",
2718
"phpbenchmarks/symfony": "1.0.0"
2819
},
29-
"require-dev": {
30-
"sensio/generator-bundle": "^3.0",
31-
"symfony/phpunit-bridge": "^3.0"
32-
},
3320
"scripts": {
3421
"symfony-scripts": [
3522
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",

0 commit comments

Comments
 (0)