Skip to content

Commit 5970298

Browse files
committed
Use phpbenchmarks/symfony dependency
1 parent 7a664ff commit 5970298

25 files changed

+4023
-488
lines changed

README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1-
sf23
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, 2015, 4:53 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.3.
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.3.42
22+
23+
Benchmark | Tool | PHP | Score
24+
--------- | ---- | --- | -----
25+
[Hello World](http://www.phpbenchmarks.com/en/benchmark/apache-bench/php-7.1/symfony-2.3.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.3.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.3.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'), true)) {
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($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
39+
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
3440
}
3541
}

app/config/config.yml

Lines changed: 8 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,20 @@
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:
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
1816
default_locale: "%locale%"
1917
trusted_proxies: ~
20-
session: ~
21-
fragments: ~
18+
session: ~
19+
fragments: ~
2220
http_method_override: true
23-
24-
# Twig Configuration
25-
twig:
26-
debug: "%kernel.debug%"
27-
strict_variables: "%kernel.debug%"
28-
29-
# Assetic Configuration
30-
assetic:
31-
debug: "%kernel.debug%"
32-
use_controller: false
33-
bundles: [ ]
34-
#java: /usr/bin/java
35-
filters:
36-
cssrewrite: ~
37-
#closure:
38-
# jar: "%kernel.root_dir%/Resources/java/compiler.jar"
39-
#yui_css:
40-
# jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
41-
42-
# Doctrine Configuration
43-
doctrine:
44-
dbal:
45-
driver: "%database_driver%"
46-
host: "%database_host%"
47-
port: "%database_port%"
48-
dbname: "%database_name%"
49-
user: "%database_user%"
50-
password: "%database_password%"
51-
charset: UTF8
52-
# if using pdo_sqlite as your database driver:
53-
# 1. add the path in parameters.yml
54-
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
55-
# 2. Uncomment database_path in parameters.yml.dist
56-
# 3. Uncomment next line:
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_dev.yml

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

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 & 23 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 & 4 deletions
This file was deleted.

composer.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
"name": "phpbenchmarks/symfony-2-3",
33
"license": "proprietary",
44
"type": "project",
5-
"autoload": {
6-
"psr-0": {
7-
"": "src/"
8-
}
9-
},
105
"require": {
116
"php": ">=5.3.3",
127
"symfony/symfony": "2.3.*",
@@ -19,22 +14,19 @@
1914
"sensio/distribution-bundle": "~2.3",
2015
"sensio/framework-extra-bundle": "^3.0.2",
2116
"sensio/generator-bundle": "~2.3",
22-
"incenteev/composer-parameter-handler": "~2.0"
17+
"incenteev/composer-parameter-handler": "~2.0",
18+
"phpbenchmarks/symfony": "2.0.0"
2319
},
2420
"scripts": {
2521
"post-install-cmd": [
2622
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
2723
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
28-
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
29-
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
3024
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
3125
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
3226
],
3327
"post-update-cmd": [
3428
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
3529
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
36-
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
37-
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
3830
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
3931
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
4032
]

0 commit comments

Comments
 (0)