Skip to content

Commit 31a1610

Browse files
Merge pull request #6 from janimattiellonen/2.1
changes for 2.1 upgrade
2 parents b80f7a7 + 9bb33af commit 31a1610

File tree

12 files changed

+2409
-81
lines changed

12 files changed

+2409
-81
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
/app/bootstrap*
33
/app/cache/*
44
/app/logs/*
5-
/vendor/
5+
/vendor
66
/app/config/parameters.ini
7+
app/config/parameters.yml
78
/nbproject
89
node_modules
910
.idea
@@ -12,3 +13,4 @@ node_modules
1213
/web/js/*
1314
/data
1415
.DS_Store
16+
composer.phar

app/AppKernel.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ public function registerBundles()
1313
new Symfony\Bundle\TwigBundle\TwigBundle(),
1414
new Symfony\Bundle\MonologBundle\MonologBundle(),
1515
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
16-
new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
16+
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
1717
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
1818
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
1919
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
20+
new JMS\AopBundle\JMSAopBundle(),
21+
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
2022
);
2123

2224
$bundles[] = new Stats\BankBundle\StatsBankBundle();

app/autoload.php

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,16 @@
11
<?php
22

3-
use Symfony\Component\ClassLoader\UniversalClassLoader;
43
use Doctrine\Common\Annotations\AnnotationRegistry;
54

6-
$loader = new UniversalClassLoader();
7-
$loader->registerNamespaces(array(
8-
'Symfony' => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
9-
'Sensio' => __DIR__.'/../vendor/bundles',
10-
'JMS' => __DIR__.'/../vendor/bundles',
11-
'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
12-
'Doctrine\\DBAL' => __DIR__.'/../vendor/doctrine-dbal/lib',
13-
'Doctrine' => __DIR__.'/../vendor/doctrine/lib',
14-
'Monolog' => __DIR__.'/../vendor/monolog/src',
15-
'Assetic' => __DIR__.'/../vendor/assetic/src',
16-
'Metadata' => __DIR__.'/../vendor/metadata/src',
17-
'Jme' => __DIR__.'/../vendor/jme/lib'
18-
));
19-
$loader->registerPrefixes(array(
20-
'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
21-
'Twig_' => __DIR__.'/../vendor/twig/lib',
22-
));
5+
$loader = require __DIR__.'/../vendor/autoload.php';
236

247
// intl
258
if (!function_exists('intl_get_error_code')) {
26-
require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
9+
require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
2710

28-
$loader->registerPrefixFallbacks(array(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
11+
$loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
2912
}
3013

31-
$loader->registerNamespaceFallbacks(array(
32-
__DIR__.'/../src',
33-
));
34-
$loader->register();
35-
36-
AnnotationRegistry::registerLoader(function($class) use ($loader) {
37-
$loader->loadClass($class);
38-
return class_exists($class, false);
39-
});
40-
AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
41-
42-
// Swiftmailer needs a special autoloader to allow
43-
// the lazy loading of the init file (which is expensive)
44-
require_once __DIR__.'/../vendor/swiftmailer/lib/classes/Swift.php';
45-
Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/lib/swift_init.php');
14+
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
4615

16+
return $loader;

app/config/config.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
imports:
2-
- { resource: parameters.ini }
2+
- { resource: parameters.yml }
33
- { resource: security.yml }
44

55
framework:
66
#esi: ~
77
#translator: { fallback: %locale% }
88
secret: %secret%
9-
charset: UTF-8
10-
router: { resource: "%kernel.root_dir%/config/routing.yml" }
9+
router:
10+
resource: "%kernel.root_dir%/config/routing.yml"
11+
strict_requirements: %kernel.debug%
1112
form: true
1213
csrf_protection: true
1314
validation: { enable_annotations: true }
14-
templating: { engines: ['twig'] } #assets_version: SomeVersionScheme
15-
session:
16-
default_locale: %locale%
17-
auto_start: true
15+
templating: { engines: ['twig'], assets_version: 1337 }
16+
default_locale: %locale%
17+
session: ~
1818

1919
# Twig Configuration
2020
twig:
2121
debug: %kernel.debug%
2222
strict_variables: %kernel.debug%
23+
globals:
24+
domain: %domain%
2325

2426
# Assetic Configuration
2527
assetic:
@@ -72,9 +74,5 @@ swiftmailer:
7274
username: %mailer_user%
7375
password: %mailer_password%
7476

75-
jms_security_extra:
76-
secure_controllers: true
77-
secure_all_services: false
78-
7977
parameters:
8078
upload_dir: %kernel.root_dir%/../data/uploads/temp

app/config/parameters.dist.ini

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

app/config/parameters.dist.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
parameters:
2+
database_driver: pdo_mysql
3+
database_host: 127.0.0.1
4+
database_port: ~
5+
database_name: bankstats_db
6+
database_user: admin
7+
database_password: ~
8+
9+
mailer_transport: smtp
10+
mailer_host: localhost
11+
mailer_user: ~
12+
mailer_password: ~
13+
14+
locale: fi
15+
secret: jdshgfjsdhkgruwyetruyegsfjksdbg
16+
node_bin: /opt/local/bin/node
17+
18+
domain: bankstats.localhost
19+
20+
# use one of these
21+
# use this if you have node in your project folder:
22+
node_modules_path: %kernel.root_dir%/../node_modules
23+
24+
# default global setting for node in Linux:
25+
#node_modules_path: /usr/lib/node_modules

app/config/security.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
jms_security_extra:
2+
secure_all_services: false
3+
expressions: true
4+
15
security:
6+
27
encoders:
38
Symfony\Component\Security\Core\User\User: plaintext
49

@@ -7,10 +12,11 @@ security:
712
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
813

914
providers:
10-
in_memory:
11-
users:
12-
user: { password: userpass, roles: [ 'ROLE_USER' ] }
13-
admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
15+
test_provider:
16+
memory:
17+
users:
18+
user: { password: userpass, roles: [ 'ROLE_USER' ] }
19+
admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
1420

1521
firewalls:
1622
dev:

composer.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"name": "jme/bankstats",
3+
"description": "My economy in graphs",
4+
"autoload": {
5+
"psr-0": { "": "src/" }
6+
},
7+
"minimum-stability": "dev",
8+
"require": {
9+
"php": ">=5.3.3",
10+
"symfony/symfony": "2.1.6",
11+
"doctrine/orm": "2.2.*",
12+
"doctrine/doctrine-bundle": "1.0.*",
13+
14+
"twig/extensions": "dev-master",
15+
"symfony/assetic-bundle": "2.1.x-dev",
16+
"symfony/swiftmailer-bundle": "2.1.x-dev",
17+
"symfony/monolog-bundle": "2.1.0-RC1",
18+
"sensio/distribution-bundle": "2.1.x-dev",
19+
"sensio/framework-extra-bundle": "2.1.x-dev",
20+
"sensio/generator-bundle": "2.1.x-dev",
21+
"jms/security-extra-bundle": "1.1.*",
22+
"jms/di-extra-bundle": "1.0.*",
23+
24+
"swiftmailer/swiftmailer": "v4.2.0",
25+
"monolog/monolog": "1.1.0",
26+
"twig/twig": "1.9.1",
27+
28+
"gedmo/doctrine-extensions": "2.3.x-dev",
29+
"beberlei/DoctrineExtensions": "dev-master",
30+
"fpn/doctrine-extensions-taggable": "dev-master",
31+
"fpn/tag-bundle": "dev-master",
32+
"willdurand/expose-translation-bundle": "dev-master",
33+
"stof/doctrine-extensions-bundle": "dev-master",
34+
"jms/serializer-bundle": "0.9.0",
35+
"friendsofsymfony/user-bundle": "dev-master",
36+
"friendsofsymfony/rest-bundle": "0.8.0",
37+
"friendsofsymfony/comment-bundle": "dev-master",
38+
"stfalcon/tinymce-bundle": "dev-master",
39+
"zendframework/zendframework": "2.0.0rc3",
40+
"besimple/i18n-routing-bundle": "2.1.*@dev",
41+
42+
"knplabs/knp-menu-bundle": "v1.1.0",
43+
"doctrine/doctrine-migrations-bundle": "dev-master"
44+
},
45+
"scripts": {
46+
"post-install-cmd": [
47+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
48+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
49+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets"
50+
],
51+
"post-update-cmd": [
52+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
53+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
54+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets"
55+
]
56+
},
57+
"config": {
58+
"bin-dir": "bin"
59+
},
60+
"extra": {
61+
"symfony-app-dir": "app",
62+
"symfony-web-dir": "web"
63+
}
64+
}

0 commit comments

Comments
 (0)