Skip to content

Commit 84f86e0

Browse files
committed
Use phpbenchmarks/symfony dependency
1 parent e41b24a commit 84f86e0

26 files changed

+3886
-526
lines changed

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
1-
2.6
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>
6+
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.6.
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.6.13
22+
23+
Benchmark | Tool | PHP | Score
24+
--------- | ---- | --- | -----
25+
[Hello World](http://www.phpbenchmarks.com/en/benchmark/apache-bench/php-7.1/symfony-2.6.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.6.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.6.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: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +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 Symfony\Bundle\AsseticBundle\AsseticBundle(),
17-
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
1828
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
19-
new PHPBenchmarks\BenchmarkBundle\BenchmarkBundle()
2029
);
21-
22-
if (in_array($this->getEnvironment(), array('dev'))) {
23-
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
24-
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
25-
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
26-
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
30+
foreach ($this->bundleClasses as $bundleClass) {
31+
$bundles[] = new $bundleClass();
2732
}
2833

2934
return $bundles;
3035
}
3136

3237
public function registerContainerConfiguration(LoaderInterface $loader)
3338
{
34-
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
39+
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
3540
}
3641
}

app/Resources/views/base.html.twig

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

app/Resources/views/default/index.html.twig

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

app/config/config.yml

Lines changed: 10 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,23 @@
11
imports:
22
- { resource: parameters.yml }
3-
- { resource: security.yml }
3+
4+
parameters:
5+
locale: en
46

57
framework:
6-
#esi: ~
7-
#translator: { fallbacks: ["%locale%"] }
8-
secret: "%secret%"
8+
secret: "%secret%"
99
router:
1010
resource: "%kernel.root_dir%/config/routing.yml"
1111
strict_requirements: ~
12-
form: ~
12+
form: ~
1313
csrf_protection: ~
14-
validation: { enable_annotations: true }
14+
validation: { enable_annotations: true }
1515
templating:
1616
engines: ['twig']
17-
#assets_version: SomeVersionScheme
18-
default_locale: "%locale%"
19-
trusted_hosts: ~
17+
default_locale: "%locale%"
18+
trusted_hosts: ~
2019
trusted_proxies: ~
2120
session:
22-
# handler_id set to null will use default session handler from php.ini
23-
handler_id: ~
24-
fragments: ~
21+
handler_id: ~
22+
fragments: ~
2523
http_method_override: true
26-
27-
# Twig Configuration
28-
twig:
29-
debug: "%kernel.debug%"
30-
strict_variables: "%kernel.debug%"
31-
32-
# Assetic Configuration
33-
assetic:
34-
debug: "%kernel.debug%"
35-
use_controller: false
36-
bundles: [ ]
37-
#java: /usr/bin/java
38-
filters:
39-
cssrewrite: ~
40-
#closure:
41-
# jar: "%kernel.root_dir%/Resources/java/compiler.jar"
42-
#yui_css:
43-
# jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
44-
45-
# Doctrine Configuration
46-
doctrine:
47-
dbal:
48-
driver: "%database_driver%"
49-
host: "%database_host%"
50-
port: "%database_port%"
51-
dbname: "%database_name%"
52-
user: "%database_user%"
53-
password: "%database_password%"
54-
charset: UTF8
55-
# if using pdo_sqlite as your database driver:
56-
# 1. add the path in parameters.yml
57-
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
58-
# 2. Uncomment database_path in parameters.yml.dist
59-
# 3. Uncomment next line:
60-
# path: "%database_path%"
61-
62-
orm:
63-
auto_generate_proxy_classes: "%kernel.debug%"
64-
auto_mapping: true
65-
66-
# Swiftmailer Configuration
67-
swiftmailer:
68-
transport: "%mailer_transport%"
69-
host: "%mailer_host%"
70-
username: "%mailer_user%"
71-
password: "%mailer_password%"
72-
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 & 25 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/parameters.yml.dist

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
1-
# This file is a "template" of what your parameters.yml file should look like
21
parameters:
3-
database_driver: pdo_mysql
4-
database_host: 127.0.0.1
5-
database_port: ~
6-
database_name: symfony
7-
database_user: root
2+
database_driver: pdo_mysql
3+
database_host: 127.0.0.1
4+
database_port: ~
5+
database_name: symfony
6+
database_user: root
87
database_password: ~
9-
# You should uncomment this if you want use pdo_sqlite
10-
# database_path: "%kernel.root_dir%/data.db3"
11-
12-
mailer_transport: smtp
13-
mailer_host: 127.0.0.1
14-
mailer_user: ~
15-
mailer_password: ~
16-
17-
locale: en
18-
19-
# A secret key that's used to generate certain security-related tokens
20-
secret: ThisTokenIsNotSoSecretChangeIt
8+
secret: ThisTokenIsNotSoSecretChangeIt

app/config/routing.yml

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

0 commit comments

Comments
 (0)