Skip to content

Commit 876a22a

Browse files
committed
Use phpbenchmarks/symfony dependency
1 parent b64fdf8 commit 876a22a

File tree

20 files changed

+260
-481
lines changed

20 files changed

+260
-481
lines changed

README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1-
2.8
2-
===
1+
<p align="center">
2+
<img src="http://www.phpbenchmarks.com/images/logo_github.png">
3+
<br>
4+
<a href="http://www.phpbenchmarks.com" target="_blank">www.phpbenchmarks.com</a>
5+
</p>
36

4-
A Symfony project created on October 9, 2017, 3:28 pm.
7+
## What is www.phpbenchmarks.com ?
8+
9+
You will find lot of benchmarks for PHP frameworks, ORM and libs here.
10+
11+
You can compare results between Apache Bench and Siege, PHP 5.6 to 7.2 and versions of your favorites PHP code.
12+
13+
## What is this repository ?
14+
15+
It's benchmark source code for Symfony 2.8.
16+
17+
You will not find final source code here, as it's in [phpbenchmarks/symfony](https://github.com/phpbenchmarks/symfony/tree/1.0.0) dependency.
18+
19+
You can find how we benchmark it [here](http://www.phpbenchmarks.com/en/benchmark-protocol).
20+
21+
## Symfony 2.8.28
22+
23+
Benchmark | Tool | PHP | Score
24+
--------- | ---- | --- | -----
25+
[Hello World](http://www.phpbenchmarks.com/en/benchmark/apache-bench/php-7.1/symfony-2.8.html#benchmark-hello-world) | Apache Bench | 7.1 | In progress
26+
[News](http://www.phpbenchmarks.com/en/benchmark/apache-bench/php-7.1/symfony-2.8.html#benchmark-news) | Apache Bench | 7.1 | In progress
27+
[Rest API](http://www.phpbenchmarks.com/en/benchmark/apache-bench/php-7.1/symfony-2.8.html#benchmark-rest) | Apache Bench | 7.1 | In progress
28+
29+
Scores are too low ? Do not hesitate to create a pull request, and ask a new benchmark !

app/AppKernel.php

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,37 @@
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+
823
public function registerBundles()
924
{
1025
$bundles = array(
1126
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
12-
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
1327
new Symfony\Bundle\TwigBundle\TwigBundle(),
14-
new Symfony\Bundle\MonologBundle\MonologBundle(),
15-
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
16-
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
1728
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
18-
new PHPBenchmarks\BenchmarkBundle\BenchmarkBundle(),
1929
);
30+
foreach ($this->bundleClasses as $bundleClass) {
31+
$bundles[] = new $bundleClass();
32+
}
2033

2134
return $bundles;
2235
}
2336

2437
public function registerContainerConfiguration(LoaderInterface $loader)
2538
{
26-
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
39+
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
2740
}
2841
}

app/config/config.yml

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
imports:
22
- { resource: parameters.yml }
3-
- { resource: security.yml }
43

5-
# Put parameters here that don't need to change on each machine where the app is deployed
6-
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
74
parameters:
85
locale: en
96

107
framework:
11-
#esi: ~
12-
#translator: { fallbacks: ['%locale%'] }
138
secret: '%secret%'
149
router:
1510
resource: '%kernel.root_dir%/config/routing.yml'
@@ -24,42 +19,6 @@ framework:
2419
trusted_hosts: ~
2520
trusted_proxies: ~
2621
session:
27-
# handler_id set to null will use default session handler from php.ini
2822
handler_id: ~
2923
fragments: ~
3024
http_method_override: true
31-
32-
# Twig Configuration
33-
twig:
34-
debug: '%kernel.debug%'
35-
strict_variables: '%kernel.debug%'
36-
37-
# Doctrine Configuration
38-
doctrine:
39-
dbal:
40-
driver: pdo_mysql
41-
host: '%database_host%'
42-
port: '%database_port%'
43-
dbname: '%database_name%'
44-
user: '%database_user%'
45-
password: '%database_password%'
46-
charset: UTF8
47-
# if using pdo_sqlite as your database driver:
48-
# 1. add the path in parameters.yml
49-
# e.g. database_path: '%kernel.root_dir%/data/data.db3'
50-
# 2. Uncomment database_path in parameters.yml.dist
51-
# 3. Uncomment next line:
52-
#path: '%database_path%'
53-
54-
orm:
55-
auto_generate_proxy_classes: '%kernel.debug%'
56-
naming_strategy: doctrine.orm.naming_strategy.underscore
57-
auto_mapping: true
58-
59-
# Swiftmailer Configuration
60-
swiftmailer:
61-
transport: '%mailer_transport%'
62-
host: '%mailer_host%'
63-
username: '%mailer_user%'
64-
password: '%mailer_password%'
65-
spool: { type: memory }

app/config/config_helloworld.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
imports:
2+
- { resource: config.yml }
3+
4+
framework:
5+
router:
6+
resource: "@HelloWorldBundle/Resources/config/routing.yml"

app/config/config_prod.yml

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

app/config/config_rest.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
imports:
2+
- { resource: config.yml }
3+
4+
framework:
5+
router:
6+
resource: "@RestBundle/Resources/config/routing.yml"
7+
serializer:
8+
enabled: true
9+
translator:
10+
enabled: true

app/config/routing.yml

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

composer.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"license": "proprietary",
44
"type": "project",
55
"autoload": {
6-
"psr-4": {
7-
"": "src/"
8-
},
96
"classmap": [
107
"app/AppKernel.php",
118
"app/AppCache.php"
@@ -26,11 +23,11 @@
2623
"symfony/monolog-bundle": "^3.0.2",
2724
"symfony/swiftmailer-bundle": "~2.3,>=2.3.10",
2825
"symfony/symfony": "2.8.*",
29-
"twig/twig": "^1.0||^2.0"
26+
"twig/twig": "^1.0||^2.0",
27+
"phpbenchmarks/symfony": "1.0.0"
3028
},
3129
"require-dev": {
32-
"sensio/generator-bundle": "~3.0",
33-
"symfony/phpunit-bridge": "~2.7"
30+
"sensio/generator-bundle": "~3.0"
3431
},
3532
"scripts": {
3633
"symfony-scripts": [

0 commit comments

Comments
 (0)