Skip to content

Commit ea3d91f

Browse files
committed
Merge branch '2.5' into 2.6
* 2.5: Minor fixes and added Fabric tool Fixed case where definition service is an alias Fixed grammar issues Improved the text of the links Updated the contents of the generic Deployment article Fixed semantic error
2 parents af5c4e3 + 747696a commit ea3d91f

File tree

3 files changed

+60
-73
lines changed

3 files changed

+60
-73
lines changed

components/dependency_injection/tags.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ custom tag::
133133
{
134134
public function process(ContainerBuilder $container)
135135
{
136-
if (!$container->hasDefinition('acme_mailer.transport_chain')) {
136+
if (!$container->has('acme_mailer.transport_chain')) {
137137
return;
138138
}
139139

140-
$definition = $container->getDefinition(
140+
$definition = $container->findDefinition(
141141
'acme_mailer.transport_chain'
142142
);
143143

cookbook/bundles/extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ should also override
7070
:method:`Extension::getAlias() <Symfony\\Component\\DependencyInjection\\Extension\\Extension::getAlias>`
7171
to return the correct DI alias. The DI alias is the name used to refer to the
7272
bundle in the container (e.g. in the ``app/config/config.yml`` file). By
73-
default, this is done by removing the ``Extension`` prefix and converting the
73+
default, this is done by removing the ``Extension`` suffix and converting the
7474
class name to underscores (e.g. ``AcmeHelloExtension``'s DI alias is
7575
``acme_hello``).
7676

cookbook/deployment/tools.rst

Lines changed: 57 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ How to Deploy a Symfony Application
88

99
.. note::
1010

11-
Deploying can be a complex and varied task depending on your setup and needs.
12-
This entry doesn't try to explain everything, but rather offers the most
13-
common requirements and ideas for deployment.
11+
Deploying can be a complex and varied task depending on the setup and the
12+
requirements of your application. This article is not a step-by-step guide,
13+
but is a general list of the most common requirements and ideas for deployment.
1414

1515
.. _symfony2-deployment-basics:
1616

@@ -19,26 +19,27 @@ Symfony Deployment Basics
1919

2020
The typical steps taken while deploying a Symfony application include:
2121

22-
#. Upload your modified code to the live server;
23-
#. Update your vendor dependencies (typically done via Composer, and may
24-
be done before uploading);
22+
#. Upload your code to the production server;
23+
#. Install your vendor dependencies (typically done via Composer and may be done
24+
before uploading);
2525
#. Running database migrations or similar tasks to update any changed data structures;
26-
#. Clearing (and perhaps more importantly, warming up) your cache.
26+
#. Clearing (and optionally, warming up) your cache.
2727

28-
A deployment may also include other things, such as:
28+
A deployment may also include other tasks, such as:
2929

30-
* Tagging a particular version of your code as a release in your source control repository;
30+
* Tagging a particular version of your code as a release in your source control
31+
repository;
3132
* Creating a temporary staging area to build your updated setup "offline";
3233
* Running any tests available to ensure code and/or server stability;
33-
* Removal of any unnecessary files from ``web`` to keep your production environment clean;
34+
* Removal of any unnecessary files from the ``web/`` directory to keep your
35+
production environment clean;
3436
* Clearing of external cache systems (like `Memcached`_ or `Redis`_).
3537

3638
How to Deploy a Symfony Application
3739
-----------------------------------
3840

39-
There are several ways you can deploy a Symfony application.
40-
41-
Start with a few basic deployment strategies and build up from there.
41+
There are several ways you can deploy a Symfony application. Start with a few
42+
basic deployment strategies and build up from there.
4243

4344
Basic File Transfer
4445
~~~~~~~~~~~~~~~~~~~
@@ -62,12 +63,39 @@ manually taking other steps (see `Common Post-Deployment Tasks`_).
6263
Using Build Scripts and other Tools
6364
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6465

65-
There are also high-quality tools to help ease the pain of deployment. There
66-
are even a few tools which have been specifically tailored to the requirements of
67-
Symfony, and which take special care to ensure that everything before, during,
68-
and after a deployment has gone correctly.
66+
There are also tools to help ease the pain of deployment. Some of them have been
67+
specifically tailored to the requirements of Symfony.
68+
69+
`Capifony`_
70+
This Ruby-based tool provides a specialized set of tools on top of
71+
`Capistrano`_, tailored specifically to Symfony projects.
72+
73+
`sf2debpkg`_
74+
Helps you build a native Debian package for your Symfony project.
6975

70-
See `The Tools`_ for a list of tools that can help with deployment.
76+
`Magallanes`_
77+
This Capistrano-like deployment tool is built in PHP, and may be easier
78+
for PHP developers to extend for their needs.
79+
80+
`Fabric`_
81+
This Python-based library provides a basic suite of operations for executing
82+
local or remote shell commands and uploading/downloading files.
83+
84+
Bundles
85+
There are some `bundles that add deployment features`_ directly into your
86+
Symfony console.
87+
88+
Basic scripting
89+
You can of course use shell, `Ant`_ or any other build tool to script
90+
the deploying of your project.
91+
92+
Platform as a Service Providers
93+
The Symfony Cookbook includes detailed articles for some of the most well-known
94+
Platform as a Service (PaaS) providers:
95+
96+
* :doc:`Microsoft Azure </cookbook/deployment/azure-website>`
97+
* :doc:`Heroku </cookbook/deployment/heroku>`
98+
* :doc:`Platform.sh </cookbook/deployment/platformsh>`
7199

72100
Common Post-Deployment Tasks
73101
----------------------------
@@ -87,12 +115,11 @@ Check if your server meets the requirements by running:
87115
B) Configure your ``app/config/parameters.yml`` File
88116
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89117

90-
This file should be customized on each system. The method you use to
91-
deploy your source code should *not* deploy this file. Instead, you should
92-
set it up manually (or via some build process) on your server(s).
118+
This file should *not* be deployed, but managed through the automatic utilities
119+
provided by Symfony.
93120

94-
C) Update your Vendors
95-
~~~~~~~~~~~~~~~~~~~~~~
121+
C) Install/Update your Vendors
122+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96123

97124
Your vendors can be updated before transferring your source code (i.e.
98125
update the ``vendor/`` directory, then transfer that with your source
@@ -105,10 +132,9 @@ as you normally do:
105132
106133
.. tip::
107134

108-
The ``--optimize-autoloader`` flag makes Composer's autoloader more
109-
performant by building a "class map". The ``--no-dev`` flag
110-
ensures that development packages are not installed in the production
111-
environment.
135+
The ``--optimize-autoloader`` flag improves Composer's autoloader performance
136+
significantly by building a "class map". The ``--no-dev`` flag ensures that
137+
development packages are not installed in the production environment.
112138

113139
.. caution::
114140

@@ -152,7 +178,7 @@ Application Lifecycle: Continuous Integration, QA, etc
152178

153179
While this entry covers the technical details of deploying, the full lifecycle
154180
of taking code from development up to production may have a lot more steps
155-
(think deploying to staging, QA, running tests, etc).
181+
(think deploying to staging, QA (Quality Assurance), running tests, etc).
156182

157183
The use of staging, testing, QA, continuous integration, database migrations
158184
and the capability to roll back in case of failure are all strongly advised. There
@@ -163,51 +189,12 @@ Don't forget that deploying your application also involves updating any dependen
163189
(typically via Composer), migrating your database, clearing your cache and
164190
other potential things like pushing assets to a CDN (see `Common Post-Deployment Tasks`_).
165191

166-
The Tools
167-
---------
168-
169-
`Capifony`_:
170-
171-
This tool provides a specialized set of tools on top of Capistrano, tailored
172-
specifically to symfony and Symfony projects.
173-
174-
`sf2debpkg`_:
175-
176-
This tool helps you build a native Debian package for your Symfony project.
177-
178-
`Magallanes`_:
179-
180-
This Capistrano-like deployment tool is built in PHP, and may be easier
181-
for PHP developers to extend for their needs.
182-
183-
Bundles:
184-
185-
There are many `bundles that add deployment features`_ directly into your
186-
Symfony console.
187-
188-
Basic scripting:
189-
190-
You can of course use shell, `Ant`_, or any other build tool to script
191-
the deploying of your project.
192-
193-
Platform as a Service Providers:
194-
195-
PaaS is a relatively new way to deploy your application. Typically a PaaS
196-
will use a single configuration file in your project's root directory to
197-
determine how to build an environment on the fly that supports your software.
198-
One provider with confirmed Symfony support is `PagodaBox`_.
199-
200-
.. tip::
201-
202-
Looking for more? Talk to the community on the `Symfony IRC channel`_ #symfony
203-
(on freenode) for more information.
204-
205192
.. _`Capifony`: http://capifony.org/
193+
.. _`Capistrano`: http://capistranorb.com/
206194
.. _`sf2debpkg`: https://github.com/liip/sf2debpkg
207-
.. _`Ant`: http://blog.sznapka.pl/deploying-symfony2-applications-with-ant
208-
.. _`PagodaBox`: https://github.com/jmather/pagoda-symfony-sonata-distribution/blob/master/Boxfile
195+
.. _`Fabric`: http://www.fabfile.org/
209196
.. _`Magallanes`: https://github.com/andres-montanez/Magallanes
197+
.. _`Ant`: http://blog.sznapka.pl/deploying-symfony2-applications-with-ant
210198
.. _`bundles that add deployment features`: http://knpbundles.com/search?q=deploy
211-
.. _`Symfony IRC channel`: http://webchat.freenode.net/?channels=symfony
212199
.. _`Memcached`: http://memcached.org/
213200
.. _`Redis`: http://redis.io/

0 commit comments

Comments
 (0)