Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Commit b815a2f

Browse files
committed
added information about Composer in the README file
1 parent 623dfab commit b815a2f

File tree

1 file changed

+51
-21
lines changed

1 file changed

+51
-21
lines changed

UPGRADE.md

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,57 @@ Symfony Standard Edition Upgrade
44
From Symfony 2.0 to Symfony 2.1
55
-------------------------------
66

7+
### Project Dependencies
8+
9+
As of Symfony 2.1, project dependencies are managed by
10+
[Composer](http://getcomposer.org/):
11+
12+
* The `bin/vendors` script can be removed as `composer.phar` does all the work
13+
now (it is recommended to install it globally on your machine).
14+
15+
* The `deps` file need to be replaced with the `composer.json` one.
16+
17+
* The `composer.lock` is the equivalent of the generated `deps.lock` file and
18+
it is automatically generated by Composer.
19+
20+
Download the default
21+
[`composer.json`](https://raw.github.com/symfony/symfony-standard/master/composer.json)
22+
and
23+
[`composer.lock`](https://raw.github.com/symfony/symfony-standard/master/composer.lock)
24+
files for Symfony 2.1 and put them into the main directory of your project. If
25+
you have customized your `deps` file, move the added dependencies to the
26+
`composer.json` file (many bundles and PHP libraries are already available as
27+
Composer packages -- search for them on [Packagist](http://packagist.org/)).
28+
29+
Remove your current `vendors` directory.
30+
31+
Finally, run Composer:
32+
33+
$ composer.phar install
34+
35+
### `app/autoload.php`
36+
37+
The default `autoload.php` reads as follows (it has been simplified a lot as
38+
autoloading for libraries and bundles declared in your `composer.json` file is
39+
automatically managed by the Composer autoloader):
40+
41+
<?php
42+
43+
use Doctrine\Common\Annotations\AnnotationRegistry;
44+
45+
$loader = include __DIR__.'/../vendor/autoload.php';
46+
47+
// intl
48+
if (!function_exists('intl_get_error_code')) {
49+
require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
50+
51+
$loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
52+
}
53+
54+
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
55+
56+
return $loader;
57+
758
### `app/config/config.yml`
859

960
The `framework.charset` setting must be removed. If you are not using `UTF-8`
@@ -130,27 +181,6 @@ The following bundles was added to the list of default registered bundles:
130181
`new JMS\AopBundle\JMSAopBundle(),
131182
`new JMS\DiExtraBundle\JMSDiExtraBundle($this),
132183

133-
### `app/autoload.php`
134-
135-
The default `autoload.php` reads as follows:
136-
137-
<?php
138-
139-
use Doctrine\Common\Annotations\AnnotationRegistry;
140-
141-
$loader = include __DIR__.'/../vendor/autoload.php';
142-
143-
// intl
144-
if (!function_exists('intl_get_error_code')) {
145-
require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
146-
147-
$loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
148-
}
149-
150-
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
151-
152-
return $loader;
153-
154184
### `web/app.php`
155185

156186
The default `web/app.php` file now reads as follows:

0 commit comments

Comments
 (0)