Skip to content

Instantly share code, notes, and snippets.

@snc
Created April 25, 2012 10:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snc/2488761 to your computer and use it in GitHub Desktop.
Save snc/2488761 to your computer and use it in GitHub Desktop.
Symfony 2.0.x with composer
#!/bin/sh
cd `dirname $0`
if [ -d "../vendor/symfony/symfony" ]; then
cd "../"
fi
ROOT=`pwd`
cd vendor/symfony && ln -s symfony/src
cd "$ROOT"
php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php . || exit 1
php app/console assets:install web/ || exit 1
php app/console cache:clear --no-warmup || exit 1
rm vendor/symfony/src || exit 1
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.2",
"symfony/symfony": "v2.0.12",
"doctrine/orm": "2.1.6",
"doctrine/doctrine-migrations-bundle": "dev-master",
"twig/extensions": "dev-master",
"symfony/assetic-bundle": "2.0.x-dev",
"symfony/swiftmailer-bundle": "v2.0.12",
"symfony/monolog-bundle": "v2.0.12",
"swiftmailer/swiftmailer": "4.1.5",
"sensio/distribution-bundle": "2.0.x-dev",
"sensio/framework-extra-bundle": "2.0.x-dev",
"sensio/generator-bundle": "2.0.x-dev",
"jms/security-extra-bundle": "1.1.0",
"jms/di-extra-bundle": "1.0.1"
},
"scripts": {
"post-install-cmd": [
],
"post-update-cmd": [
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web"
}
}
Index: app/config/config.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/config/config.yml (date 1335352203000)
+++ app/config/config.yml (revision )
@@ -12,8 +12,8 @@
csrf_protection: true
validation: { enable_annotations: true }
templating: { engines: ['twig'] } #assets_version: SomeVersionScheme
- default_locale: %locale%
session:
+ default_locale: %locale%
auto_start: true
# Twig Configuration
@@ -55,4 +55,3 @@
host: %mailer_host%
username: %mailer_user%
password: %mailer_password%
- spool: { type: memory }
Index: app/config/security.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/config/security.yml (date 1335352203000)
+++ app/config/security.yml (revision )
@@ -12,10 +12,9 @@
providers:
in_memory:
- memory:
- users:
- user: { password: userpass, roles: [ 'ROLE_USER' ] }
- admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
+ users:
+ user: { password: userpass, roles: [ 'ROLE_USER' ] }
+ admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
firewalls:
dev:
Index: app/AppKernel.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/AppKernel.php (date 1335352203000)
+++ app/AppKernel.php (revision )
@@ -14,7 +14,7 @@
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
- new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
+ new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
@snc
Copy link
Author

snc commented Apr 25, 2012

Usage

I hope this snippets can help you if you want to use composer and Symfony2 v2.0.x

1) Clone symfony-standard

Yes, we want the master branch!

git clone http://github.com/symfony/symfony-standard.git
cd symfony-standard
rm -rf .git

2) Replace composer.json

Simply replace the composer.json with the one from the gist.

3) Save the buildBootstrap.sh

The buildBootstrap.sh script runs the tasks from the old bin/vendors script. Simply save the file from the gist.

4) Install vendor libraries

php composer.phar update

5) Apply patch

This step fixes some BC issues. You have to save the diff.patch from the gist.

patch -p0 < diff.patch

6) Create bootstrap.php.cache etc.

sh buildBootstrap.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment