Skip to content

Commit 4e164df

Browse files
committed
Added a new articule about using/installing inestable Symfony versions
1 parent 2948d6e commit 4e164df

File tree

5 files changed

+108
-4
lines changed

5 files changed

+108
-4
lines changed

cookbook/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The Cookbook
1717
email/index
1818
event_dispatcher/index
1919
form/index
20+
install/index
2021
logging/index
2122
profiler/index
2223
request/index

cookbook/install/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Install and Upgrade
2+
===================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
7+
upgrading

cookbook/install/inestable_versions

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
How to Install and Use an Inestable Symfony Version
2+
===================================================
3+
4+
Symfony releases two new minor versions (2.5, 2.6, 2.7, etc.) per year, one in
5+
May and one in November (:doc:`see releases detail <contributing/community/releases>`).
6+
Testing the new Symfony versions in your projects as soon as possible is important
7+
to ensure that they will keep working as expected.
8+
9+
In this article you'll learn how to install and use new Symfony versions before
10+
they are released as stable versions.
11+
12+
Creating a New Project Based on an Inestable Symfony Version
13+
------------------------------------------------------------
14+
15+
Suppose that Symfony 2.7 version hasn't been released yet and you want to create
16+
a new project to test its features. First, :doc:`install Composer </cookbook/composer>`
17+
package manager. Then, open a command console, enter your projects directory and
18+
execute the following command:
19+
20+
.. code-block:: bash
21+
22+
$ composer create-project symfony/framework-standard-edition my_project "2.7.*" --stability=dev
23+
24+
Once the command finishes its execution, you'll have a new Symfony project created
25+
in the ``my_project/`` directory and based on the most recent code found in the
26+
``2.7`` branch.
27+
28+
If you want to test a beta version, use ``beta`` as the value of the ``stability``
29+
option:
30+
31+
.. code-block:: bash
32+
33+
$ composer create-project symfony/framework-standard-edition my_project "2.7.*" --stability=beta
34+
35+
Upgrading your Project to an Inestable Symfony Version
36+
------------------------------------------------------
37+
38+
Instead of creating a new empty project, in this section you'll update an existing
39+
Symfony application to an inestable framework version. Suppose again that Symfony
40+
2.7 version hasn't been released yet and you want to test it in your project.
41+
42+
First, open the ``composer.json`` file located in the root directory of your
43+
project. Then, edit the value of the version defined for the ``symfony/symfony``
44+
dependency:
45+
46+
.. code-block:: json
47+
48+
{
49+
"require": {
50+
// ...
51+
"symfony/symfony" : "2.7.*"
52+
}
53+
}
54+
55+
Then, before updating your dependencies, make sure that the project configuration
56+
allows to install inestable versions. If the ``composer.json`` file contains a
57+
``minimum-stability`` option, change its value to ``dev``. If that option doesn't
58+
exist, add it as follows:
59+
60+
.. code-block:: json
61+
62+
{
63+
"require": {
64+
// ...
65+
"symfony/symfony" : "2.7.*"
66+
},
67+
"minimum-stability": "dev"
68+
}
69+
70+
If you prefer to test a Symfony beta version, replace the ``dev`` value of the
71+
``minimum-stability`` option by ``beta``.
72+
73+
Then, open a command console, enter your project directory and execute the following command to update your project dependencies:
74+
75+
.. code-block:: bash
76+
77+
$ composer update
78+
79+
.. tip::
80+
81+
If you use Git to manage the project's code, it's a good practice to create
82+
a new branch to test the new Symfony version. This solution avoids introducing
83+
any issue in your application and allows you to test the new version with
84+
total confidence:
85+
86+
.. code-block:: bash
87+
88+
$ cd projects/my_project/
89+
$ git checkout -b testing_new_symfony
90+
// update composer.json configuration
91+
$ composer update
92+
93+
// ... after testing the new Symfony version
94+
$ git checkout master
95+
$ git branch -D testing_new_symfony
File renamed without changes.

cookbook/map.rst.inc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@
107107
* (validation) :doc:`/cookbook/validation/custom_constraint`
108108
* (doctrine) :doc:`/cookbook/doctrine/file_uploads`
109109

110+
* **Installing and Upgrading**
111+
112+
* :doc:`/cookbook/upgrading`
113+
* :doc:`/cookbook/inestable_version`
114+
110115
* :doc:`/cookbook/logging/index`
111116

112117
* :doc:`/cookbook/logging/monolog`
@@ -201,10 +206,6 @@
201206
* (email) :doc:`/cookbook/email/testing`
202207
* (form) :doc:`/cookbook/form/unit_testing`
203208

204-
* **Upgrading**
205-
206-
* :doc:`/cookbook/upgrading`
207-
208209
* :doc:`/cookbook/validation/index`
209210

210211
* :doc:`/cookbook/validation/custom_constraint`

0 commit comments

Comments
 (0)