Skip to content

Commit 0ee34e8

Browse files
committed
Use phpbenchmarks/symfony dependency
1 parent 1dfa470 commit 0ee34e8

File tree

20 files changed

+242
-414
lines changed

20 files changed

+242
-414
lines changed

README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1-
3.3
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:29 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 3.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 3.3.10
22+
23+
Benchmark | Tool | PHP | Score
24+
--------- | ---- | --- | -----
25+
[Hello World](http://www.phpbenchmarks.com/en/benchmark/apache-bench/php-7.1/symfony-3.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-3.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-3.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: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,31 @@
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
{
10-
$bundles = [
25+
$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()
19-
];
29+
);
30+
foreach ($this->bundleClasses as $bundleClass) {
31+
$bundles[] = new $bundleClass();
32+
}
2033

2134
return $bundles;
2235
}
@@ -28,16 +41,16 @@ public function getRootDir()
2841

2942
public function getCacheDir()
3043
{
31-
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
44+
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
3245
}
3346

3447
public function getLogDir()
3548
{
36-
return dirname(__DIR__).'/var/logs';
49+
return dirname(__DIR__) . '/var/logs';
3750
}
3851

3952
public function registerContainerConfiguration(LoaderInterface $loader)
4053
{
41-
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
54+
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
4255
}
4356
}

app/config/config.yml

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,26 @@
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.project_dir%/app/config/routing.yml'
1611
strict_requirements: ~
1712
form: ~
1813
csrf_protection: ~
1914
validation: { enable_annotations: true }
20-
#serializer: { enable_annotations: true }
2115
templating:
2216
engines: ['twig']
2317
default_locale: '%locale%'
2418
trusted_hosts: ~
2519
session:
26-
# https://symfony.com/doc/current/reference/configuration/framework.html#handler-id
2720
handler_id: session.handler.native_file
2821
save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
2922
fragments: ~
3023
http_method_override: true
3124
assets: ~
3225
php_errors:
33-
log: true
34-
35-
# Twig Configuration
36-
twig:
37-
debug: '%kernel.debug%'
38-
strict_variables: '%kernel.debug%'
39-
40-
# Doctrine Configuration
41-
doctrine:
42-
dbal:
43-
driver: pdo_mysql
44-
host: '%database_host%'
45-
port: '%database_port%'
46-
dbname: '%database_name%'
47-
user: '%database_user%'
48-
password: '%database_password%'
49-
charset: UTF8
50-
# if using pdo_sqlite as your database driver:
51-
# 1. add the path in parameters.yml
52-
# e.g. database_path: '%kernel.project_dir%/var/data/data.sqlite'
53-
# 2. Uncomment database_path in parameters.yml.dist
54-
# 3. Uncomment next line:
55-
#path: '%database_path%'
56-
57-
orm:
58-
auto_generate_proxy_classes: '%kernel.debug%'
59-
naming_strategy: doctrine.orm.naming_strategy.underscore
60-
auto_mapping: true
61-
62-
# Swiftmailer Configuration
63-
swiftmailer:
64-
transport: '%mailer_transport%'
65-
host: '%mailer_host%'
66-
username: '%mailer_user%'
67-
password: '%mailer_password%'
68-
spool: { type: memory }
26+
log: false

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 & 22 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: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
1-
# This file is a "template" of what your parameters.yml file should look like
2-
# Set parameters here that may be different on each deployment target of the app, e.g. development, staging, production.
3-
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
41
parameters:
52
database_host: 127.0.0.1
63
database_port: ~
74
database_name: symfony
85
database_user: root
96
database_password: ~
10-
# You should uncomment this if you want to use pdo_sqlite
11-
#database_path: '%kernel.project_dir%/var/data/data.sqlite'
12-
13-
mailer_transport: smtp
14-
mailer_host: 127.0.0.1
15-
mailer_user: ~
16-
mailer_password: ~
17-
18-
# A secret key that's used to generate certain security-related tokens
197
secret: ThisTokenIsNotSoSecretChangeIt

app/config/routing.yml

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

composer.json

Lines changed: 2 additions & 4 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"
@@ -22,7 +19,8 @@
2219
"symfony/polyfill-apcu": "^1.0",
2320
"symfony/swiftmailer-bundle": "^2.3.10",
2421
"symfony/symfony": "3.3.*",
25-
"twig/twig": "^1.0||^2.0"
22+
"twig/twig": "^1.0||^2.0",
23+
"phpbenchmarks/symfony": "1.0.0"
2624
},
2725
"require-dev": {
2826
"sensio/generator-bundle": "^3.0",

0 commit comments

Comments
 (0)