@@ -2,8 +2,8 @@ The Architecture
2
2
================
3
3
4
4
You are my hero! Who would have thought that you would still be here after the
5
- first three parts? Your efforts will be well rewarded soon. The first three
6
- parts don 't have a deep look at the architecture of the framework. As it makes
5
+ first three parts? Your efforts will be well- rewarded soon. The first three
6
+ parts didn 't look too deeply at the architecture of the framework. As it makes
7
7
Symfony2 stand apart from the framework crowd, let's dive into it now.
8
8
9
9
.. index ::
@@ -13,7 +13,7 @@ The Directory Structure
13
13
-----------------------
14
14
15
15
The directory structure of a Symfony2 :term: `application ` is rather flexible
16
- but the directory structure of a sandbox reflects the typical and recommended
16
+ but the directory structure of the sandbox reflects the typical and recommended
17
17
structure of a Symfony2 application:
18
18
19
19
* ``app/ ``: This directory contains the application configuration;
@@ -26,8 +26,8 @@ The Web Directory
26
26
~~~~~~~~~~~~~~~~~
27
27
28
28
The web root directory is the home of all public and static files like images,
29
- stylesheets, and JavaScript files. It is also where the front controllers
30
- live ::
29
+ stylesheets, and JavaScript files. It is also where each :term: ` front controller `
30
+ lives ::
31
31
32
32
// web/app.php
33
33
require_once __DIR__.'/../app/AppKernel.php';
@@ -117,15 +117,15 @@ server or locally in your projects.
117
117
The Bundle System
118
118
-----------------
119
119
120
- This section starts to scratch the surface of one of the greatest and more
121
- powerful features of Symfony2, its :term: `bundle ` system.
120
+ This section starts to scratch the surface of one of the greatest and most
121
+ powerful features of Symfony2, the :term: `bundle ` system.
122
122
123
- A bundle is kind of like a plugin in other software. But why is it called
124
- bundle and not plugin then ? Because everything is a bundle in Symfony2, from
123
+ A bundle is kind of like a plugin in other software. So why is it called
124
+ bundle and not plugin? Because * everything * is a bundle in Symfony2, from
125
125
the core framework features to the code you write for your application.
126
126
Bundles are first-class citizens in Symfony2. This gives you the flexibility to
127
127
use pre-built features packaged in third-party bundles or to distribute your
128
- own bundles. It makes it so easy to pick and choose which features to enable
128
+ own bundles. It makes it easy to pick and choose which features to enable
129
129
in your application and optimize them the way you want.
130
130
131
131
An application is made up of bundles as defined in the ``registerBundles() ``
@@ -156,8 +156,8 @@ method of the ``AppKernel`` class::
156
156
return $bundles;
157
157
}
158
158
159
- Along side the ``HelloBundle `` we have already talked about, notice that the
160
- kernel also enables ``FrameworkBundle ``, ``DoctrineBundle ``,
159
+ In addition to the ``HelloBundle `` that we have already talked about, notice
160
+ that the kernel also enables ``FrameworkBundle ``, ``DoctrineBundle ``,
161
161
``SwiftmailerBundle ``, and ``ZendBundle ``. They are all part of the core
162
162
framework.
163
163
@@ -346,9 +346,9 @@ specific configuration file:
346
346
),
347
347
));
348
348
349
- As we have seen in the previous part, an application is made of bundles as
350
- defined in the ``registerBundles() `` method but how does Symfony2 know where to
351
- look for bundles? Symfony2 is quite flexible in this regard. The
349
+ As we have seen in the previous part, an application is made up of bundles
350
+ defined in the ``registerBundles() `` method. But how does Symfony2 know where
351
+ to look for bundles? Symfony2 is quite flexible in this regard. The
352
352
``registerBundleDirs() `` method must return an associative array that maps
353
353
namespaces to any valid directory (local or global ones)::
354
354
@@ -373,10 +373,10 @@ applications, store them locally or globally, your choice.
373
373
Using Vendors
374
374
-------------
375
375
376
- Odds are your application will depend on third-party libraries. Those should
377
- be stored in the ``src/vendor/ `` directory. It already contains the Symfony2
378
- libraries, the SwiftMailer library, the Doctrine ORM, the Twig templating
379
- system, and a selection of the Zend Framework classes.
376
+ Odds are that your application will depend on third-party libraries. Those
377
+ should be stored in the ``src/vendor/ `` directory. This directory already
378
+ contains the Symfony2 libraries, the SwiftMailer library, the Doctrine ORM,
379
+ the Twig templating system, and a selection of the Zend Framework classes.
380
380
381
381
.. index ::
382
382
single: Configuration Cache
@@ -391,12 +391,12 @@ each request? This is partly due to its cache system. The application
391
391
configuration is only parsed for the very first request and then compiled down
392
392
to plain PHP code stored in the ``cache/ `` application directory. In the
393
393
development environment, Symfony2 is smart enough to flush the cache when you
394
- change a file. But in the production one , it is your responsibility to clear
395
- the cache when you update your code or change its configuration.
394
+ change a file. But in the production environment , it is your responsibility
395
+ to clear the cache when you update your code or change its configuration.
396
396
397
397
When developing a web application, things can go wrong in many ways. The log
398
398
files in the ``logs/ `` application directory tell you everything about the
399
- requests and helps you fix the problem in no time .
399
+ requests and help you fix the problem quickly .
400
400
401
401
.. index ::
402
402
single: CLI
@@ -425,13 +425,13 @@ Final Thoughts
425
425
--------------
426
426
427
427
Call me crazy, but after reading this part, you should be comfortable with
428
- moving things around and making Symfony2 works for you. Everything is done in
429
- Symfony2 to stand out of your way. So, feel free to rename and move directories
428
+ moving things around and making Symfony2 work for you. Everything is done in
429
+ Symfony2 to get out of your way. So, feel free to rename and move directories
430
430
around as you see fit.
431
431
432
432
And that's all for the quick tour. From testing to sending emails, you still
433
433
need to learn a lot to become a Symfony2 master. Ready to dig into these topics
434
- now? Look no further, go to the official `guides `_ page and pick any topic you
434
+ now? Look no further - go to the official `guides `_ page and pick any topic you
435
435
want.
436
436
437
437
.. _standards : http://groups.google.com/group/php-standards/web/psr-0-final-proposal
0 commit comments