Skip to content

Commit 2671091

Browse files
committed
Use phpbenchmarks/symfony dependency
1 parent 152783d commit 2671091

23 files changed

+3918
-427
lines changed

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
1-
2.5
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.5.
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.5.12
22+
23+
Benchmark | Tool | PHP | Score
24+
--------- | ---- | --- | -----
25+
[Hello World](http://www.phpbenchmarks.com/en/benchmark/apache-bench/php-7.1/symfony-2.5.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.5.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.5.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 & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +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\WebProfilerBundle\WebProfilerBundle();
24-
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
25-
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
30+
foreach ($this->bundleClasses as $bundleClass) {
31+
$bundles[] = new $bundleClass();
2632
}
2733

2834
return $bundles;
2935
}
3036

3137
public function registerContainerConfiguration(LoaderInterface $loader)
3238
{
33-
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
39+
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
3440
}
3541
}

app/config/config.yml

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

57
framework:
6-
#esi: ~
7-
#translator: { fallback: "%locale%" }
8-
secret: "%secret%"
8+
secret: "%secret%"
99
router:
10-
resource: "%kernel.root_dir%/config/routing.yml"
1110
strict_requirements: ~
12-
form: ~
11+
form: ~
1312
csrf_protection: ~
14-
validation: { enable_annotations: true }
13+
validation: { enable_annotations: true }
1514
templating:
1615
engines: ['twig']
17-
#assets_version: SomeVersionScheme
18-
default_locale: "%locale%"
19-
trusted_hosts: ~
16+
default_locale: "%locale%"
17+
trusted_hosts: ~
2018
trusted_proxies: ~
2119
session:
22-
# handler_id set to null will use default session handler from php.ini
23-
handler_id: ~
24-
fragments: ~
20+
handler_id: ~
21+
fragments: ~
2522
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, add the path in parameters.yml
56-
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
57-
# path: "%database_path%"
58-
59-
orm:
60-
auto_generate_proxy_classes: "%kernel.debug%"
61-
auto_mapping: true
62-
63-
# Swiftmailer Configuration
64-
swiftmailer:
65-
transport: "%mailer_transport%"
66-
host: "%mailer_host%"
67-
username: "%mailer_user%"
68-
password: "%mailer_password%"
69-
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 & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
parameters:
2-
database_driver: pdo_mysql
3-
database_host: 127.0.0.1
4-
database_port: ~
5-
database_name: symfony
6-
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
77
database_password: ~
8-
9-
mailer_transport: smtp
10-
mailer_host: 127.0.0.1
11-
mailer_user: ~
12-
mailer_password: ~
13-
14-
locale: en
15-
secret: ThisTokenIsNotSoSecretChangeIt
16-
17-
debug_toolbar: true
18-
debug_redirects: false
19-
use_assetic_controller: true
8+
secret: ThisTokenIsNotSoSecretChangeIt

app/config/routing.yml

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

composer.json

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"name": "phpbenchmarks/symfony-2-5",
3-
"license": "MIT",
3+
"license": "proprietary",
44
"type": "project",
5-
"description": "The \"Symfony Standard Edition\" distribution",
6-
"autoload": {
7-
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
8-
},
95
"require": {
106
"php": ">=5.3.3",
117
"symfony/symfony": "2.5.*",
@@ -17,28 +13,22 @@
1713
"symfony/monolog-bundle": "~2.4",
1814
"sensio/distribution-bundle": "~3.0",
1915
"sensio/framework-extra-bundle": "~3.0",
20-
"incenteev/composer-parameter-handler": "~2.0"
16+
"incenteev/composer-parameter-handler": "~2.0",
17+
"phpbenchmarks/symfony": "1.0.0"
2118
},
2219
"require-dev": {
2320
"sensio/generator-bundle": "~2.3"
2421
},
2522
"scripts": {
26-
"post-root-package-install": [
27-
"SymfonyStandard\\Composer::hookRootPackageInstall"
28-
],
2923
"post-install-cmd": [
3024
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
3125
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
32-
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
33-
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
3426
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
3527
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
3628
],
3729
"post-update-cmd": [
3830
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
3931
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
40-
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
41-
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
4232
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
4333
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
4434
]

0 commit comments

Comments
 (0)