Skip to content

Commit f625878

Browse files
committed
update to Symfony 2.1
1 parent 092b090 commit f625878

File tree

17 files changed

+150
-369
lines changed

17 files changed

+150
-369
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ vendor/
99
/.settings
1010
/.buildpath
1111
/.project
12+
composer.phar

README.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ Package Repository Website for Composer, see the [about page](http://packagist.o
66
Installation
77
------------
88

9-
- Clone the repository
10-
- Run `bin/vendors install` to get all the vendors.
11-
- Copy `app/config/parameters.yml.dist` to `app/config/parameters.yml` and edit the relevant values for your setup.
12-
- Run `app/console doctrine:schema:create` to setup the DB.
13-
- Run `app/console assets:install web` to deploy the assets on the web dir.
14-
- Make a VirtualHost with DocumentRoot pointing to web/
15-
- You should now be able to access the site, create a user, etc.
9+
1. Clone the repository
10+
2. Install dependencies: `php composer.phar install`
11+
3. Copy `app/config/parameters.yml.dist` to `app/config/parameters.yml` and edit the relevant values for your setup.
12+
4. Run `app/console doctrine:schema:create` to setup the DB.
13+
5. Run `app/console assets:install web` to deploy the assets on the web dir.
14+
6. Make a VirtualHost with DocumentRoot pointing to web/
15+
16+
You should now be able to access the site, create a user, etc.
1617

1718
Setting up search
1819
-----------------

app/AppKernel.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ public function registerBundles()
1616
new Symfony\Bundle\TwigBundle\TwigBundle(),
1717
new Symfony\Bundle\MonologBundle\MonologBundle(),
1818
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
19-
new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
2019
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
20+
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
2121
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
22+
new JMS\AopBundle\JMSAopBundle(),
23+
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
24+
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
2225
new FOS\UserBundle\FOSUserBundle(),
2326
new Snc\RedisBundle\SncRedisBundle(),
2427
new Packagist\WebBundle\PackagistWebBundle(),

app/Resources/FOSUserBundle/views/layout.html.twig

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
{% block content %}
44

5-
{% for key, flash in app.session.getFlashes() %}
6-
<div class="{{ flash }}" style="margin-bottom: 5px;">
7-
{{ key|trans({}, 'FOSUserBundle') }}
8-
</div>
5+
{% for type, flashMessages in app.session.flashbag.all() %}
6+
{% for flashMessage in flashMessages %}
7+
<div class="{{ type }}" style="margin-bottom: 5px;">
8+
{{ flashMessage|trans({}, 'FOSUserBundle') }}
9+
</div>
10+
{% endfor %}
911
{% endfor %}
1012

1113
<div class="box clearfix">

app/autoload.php

+22-44
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,32 @@
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-
'FOS' => __DIR__.'/../vendor/bundles',
18-
'Snc' => __DIR__.'/../vendor/bundles',
19-
'Predis' => __DIR__.'/../vendor/predis/lib',
20-
'Composer' => __DIR__.'/../vendor/composer/src',
21-
'Packagist' => __DIR__.'/../src',
22-
'WhiteOctober\PagerfantaBundle' => __DIR__.'/../vendor/bundles',
23-
'Pagerfanta' => __DIR__.'/../vendor/pagerfanta/src',
24-
'Nelmio' => __DIR__.'/../vendor/bundles',
25-
'Seld\JsonLint' => __DIR__.'/../vendor/jsonlint/src',
26-
));
27-
$loader->registerPrefixes(array(
28-
'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
29-
'Twig_' => __DIR__.'/../vendor/twig/lib',
30-
'Solarium_' => __DIR__.'/../vendor/solarium/library',
31-
));
5+
if (!$loader = @include __DIR__.'/../vendor/autoload.php') {
6+
7+
$message = <<< EOF
8+
<p>You must set up the project dependencies by running the following commands:</p>
9+
<pre>
10+
curl -s http://getcomposer.org/installer | php
11+
php composer.phar install
12+
</pre>
13+
14+
EOF;
15+
16+
if (PHP_SAPI === 'cli') {
17+
$message = strip_tags($message);
18+
}
19+
20+
die($message);
21+
}
3222

3323
// intl
3424
if (!function_exists('intl_get_error_code')) {
35-
require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
25+
require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
3626

37-
$loader->registerPrefixFallbacks(array(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
27+
$loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
3828
}
3929

40-
$loader->registerNamespaceFallbacks(array(
41-
__DIR__.'/../src',
42-
));
43-
$loader->register();
44-
45-
AnnotationRegistry::registerLoader(function($class) use ($loader) {
46-
$loader->loadClass($class);
47-
return class_exists($class, false);
48-
});
49-
AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
50-
51-
// Swiftmailer needs a special autoloader to allow
52-
// the lazy loading of the init file (which is expensive)
53-
require_once __DIR__.'/../vendor/swiftmailer/lib/classes/Swift.php';
54-
Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/lib/swift_init.php');
30+
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
31+
32+
return $loader;

app/config/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ framework:
1111
validation: { enable_annotations: true }
1212
translator: { fallback: en }
1313
templating: { engines: ['twig'] } #assets_version: SomeVersionScheme
14+
default_locale: %locale%
1415
session:
1516
name: packagist
16-
default_locale: %locale%
1717
lifetime: 3600
18-
auto_start: false
18+
auto_start: true
1919

2020
# Twig Configuration
2121
twig:

app/config/security.yml

+10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
jms_security_extra:
2+
secure_all_services: false
3+
expressions: true
4+
15
security:
6+
encoders:
7+
FOS\UserBundle\Model\UserInterface:
8+
algorithm: sha512
9+
encode_as_base64: false
10+
iterations: 1
11+
212
providers:
313
packagist:
414
id: packagist.user_provider

bin/vendors

-154
This file was deleted.

composer.json

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"name": "composer/packagist",
3+
"description": "Package Repository Website",
4+
"keywords": ["package", "composer"],
5+
"homepage": "http://packagist.org/",
6+
"type": "library",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "Nils Adermann",
11+
"email": "[email protected]",
12+
"homepage": "http://www.naderman.de"
13+
},
14+
{
15+
"name": "Jordi Boggiano",
16+
"email": "[email protected]",
17+
"homepage": "http://seld.be"
18+
}
19+
],
20+
"support": {
21+
"email": "[email protected]"
22+
},
23+
"autoload": {
24+
"psr-0": { "Packagist": "src/" }
25+
},
26+
"require": {
27+
"php": ">=5.3.2",
28+
"composer/composer": "dev-master",
29+
"doctrine/doctrine-bundle": "dev-master",
30+
"doctrine/orm": "2.2.*",
31+
"friendsofsymfony/user-bundle": "dev-master",
32+
"jms/di-extra-bundle": "1.0.*",
33+
"jms/security-extra-bundle": "1.1.*",
34+
"nelmio/solarium-bundle": "dev-master",
35+
"predis/predis": "0.7.*",
36+
"sensio/distribution-bundle": "dev-master",
37+
"sensio/framework-extra-bundle": "dev-master",
38+
"sensio/generator-bundle": "dev-master",
39+
"snc/redis-bundle": "dev-master",
40+
"symfony/assetic-bundle": "dev-master",
41+
"symfony/monolog-bundle": "dev-master",
42+
"symfony/swiftmailer-bundle": "dev-master",
43+
"symfony/symfony": "2.1.*",
44+
"twig/extensions": "dev-master",
45+
"white-october/pagerfanta-bundle": "dev-master"
46+
},
47+
"scripts": {
48+
"post-install-cmd": [
49+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
50+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
51+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets"
52+
],
53+
"post-update-cmd": [
54+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
55+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
56+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets"
57+
]
58+
},
59+
"config": {
60+
"bin-dir": "bin"
61+
},
62+
"extra": {
63+
"symfony-app-dir": "app",
64+
"symfony-web-dir": "web"
65+
}
66+
}

0 commit comments

Comments
 (0)