Skip to content

Commit a3326e8

Browse files
committed
Init benchmark
1 parent ff94bc4 commit a3326e8

30 files changed

+3533
-1
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/web/bundles/
2+
/var/bootstrap.php.cache
3+
/var/cache/*
4+
/app/config/parameters.yml
5+
/var/logs/*
6+
!var/cache/.gitkeep
7+
!var/logs/.gitkeep
8+
/build/
9+
/vendor/
10+
/bin/
11+
/.idea/

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
# symfony-3-0-benchmark
1+
3.0
2+
===
3+
4+
A Symfony project created on October 9, 2017, 3:28 pm.

app/.htaccess

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<IfModule mod_authz_core.c>
2+
Require all denied
3+
</IfModule>
4+
<IfModule !mod_authz_core.c>
5+
Order deny,allow
6+
Deny from all
7+
</IfModule>

app/AppCache.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
4+
5+
class AppCache extends HttpCache
6+
{
7+
}

app/AppKernel.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
use Symfony\Component\HttpKernel\Kernel;
4+
use Symfony\Component\Config\Loader\LoaderInterface;
5+
6+
class AppKernel extends Kernel
7+
{
8+
public function registerBundles()
9+
{
10+
$bundles = [
11+
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
12+
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
13+
new Symfony\Bundle\TwigBundle\TwigBundle(),
14+
new Symfony\Bundle\MonologBundle\MonologBundle(),
15+
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
16+
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
17+
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
18+
new PHPBenchmarks\BenchmarkBundle\BenchmarkBundle()
19+
];
20+
21+
return $bundles;
22+
}
23+
24+
public function getRootDir()
25+
{
26+
return __DIR__;
27+
}
28+
29+
public function getCacheDir()
30+
{
31+
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
32+
}
33+
34+
public function getLogDir()
35+
{
36+
return dirname(__DIR__).'/var/logs';
37+
}
38+
39+
public function registerContainerConfiguration(LoaderInterface $loader)
40+
{
41+
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
42+
}
43+
}

app/autoload.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
use Doctrine\Common\Annotations\AnnotationRegistry;
4+
use Composer\Autoload\ClassLoader;
5+
6+
/**
7+
* @var ClassLoader $loader
8+
*/
9+
$loader = require __DIR__.'/../vendor/autoload.php';
10+
11+
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
12+
13+
return $loader;

app/config/config.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
imports:
2+
- { resource: parameters.yml }
3+
- { resource: security.yml }
4+
5+
# Put parameters here that don't need to change on each machine where the app is deployed
6+
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
7+
parameters:
8+
locale: en
9+
10+
framework:
11+
#esi: ~
12+
#translator: { fallbacks: ["%locale%"] }
13+
secret: "%secret%"
14+
router:
15+
resource: "%kernel.root_dir%/config/routing.yml"
16+
strict_requirements: ~
17+
form: ~
18+
csrf_protection: ~
19+
validation: { enable_annotations: true }
20+
#serializer: { enable_annotations: true }
21+
templating:
22+
engines: ['twig']
23+
default_locale: "%locale%"
24+
trusted_hosts: ~
25+
trusted_proxies: ~
26+
session:
27+
# http://symfony.com/doc/current/reference/configuration/framework.html#handler-id
28+
handler_id: session.handler.native_file
29+
save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
30+
fragments: ~
31+
http_method_override: true
32+
assets: ~
33+
34+
# Twig Configuration
35+
twig:
36+
debug: "%kernel.debug%"
37+
strict_variables: "%kernel.debug%"
38+
39+
# Doctrine Configuration
40+
doctrine:
41+
dbal:
42+
driver: pdo_mysql
43+
host: "%database_host%"
44+
port: "%database_port%"
45+
dbname: "%database_name%"
46+
user: "%database_user%"
47+
password: "%database_password%"
48+
charset: UTF8
49+
# if using pdo_sqlite as your database driver:
50+
# 1. add the path in parameters.yml
51+
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
52+
# 2. Uncomment database_path in parameters.yml.dist
53+
# 3. Uncomment next line:
54+
# path: "%database_path%"
55+
56+
orm:
57+
auto_generate_proxy_classes: "%kernel.debug%"
58+
naming_strategy: doctrine.orm.naming_strategy.underscore
59+
auto_mapping: true
60+
61+
# Swiftmailer Configuration
62+
swiftmailer:
63+
transport: "%mailer_transport%"
64+
host: "%mailer_host%"
65+
username: "%mailer_user%"
66+
password: "%mailer_password%"
67+
spool: { type: memory }

app/config/config_prod.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
imports:
2+
- { resource: config.yml }
3+
4+
#framework:
5+
# validation:
6+
# cache: validator.mapping.cache.doctrine.apc
7+
# serializer:
8+
# cache: serializer.mapping.cache.apc
9+
10+
#doctrine:
11+
# orm:
12+
# metadata_cache_driver: apc
13+
# result_cache_driver: apc
14+
# query_cache_driver: apc
15+
16+
monolog:
17+
handlers:
18+
main:
19+
type: fingers_crossed
20+
action_level: error
21+
handler: nested
22+
nested:
23+
type: stream
24+
path: "%kernel.logs_dir%/%kernel.environment%.log"
25+
level: debug
26+
console:
27+
type: console

app/config/parameters.yml.dist

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
# http://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
4+
parameters:
5+
database_host: 127.0.0.1
6+
database_port: ~
7+
database_name: symfony
8+
database_user: root
9+
database_password: ~
10+
# You should uncomment this if you want use pdo_sqlite
11+
# database_path: "%kernel.root_dir%/data.db3"
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
19+
secret: ThisTokenIsNotSoSecretChangeIt

app/config/routing.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
benchmark:
2+
resource: "@BenchmarkBundle/Resources/config/routing.yml"
3+
prefix: /benchmark/

0 commit comments

Comments
 (0)