Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f47246a

Browse files
Sebastian Ionescufabpot
authored andcommitted
[QuickTour] updated listings
1 parent df6846c commit f47246a

File tree

2 files changed

+25
-38
lines changed

2 files changed

+25
-38
lines changed

quick_tour/the_architecture.rst

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,15 @@ The Web Directory
2727

2828
The web root directory is the home of all public and static files like images,
2929
stylesheets, and JavaScript files. It is also where the front controllers
30-
live:
31-
32-
.. code-block:: html+php
33-
34-
<!-- web/app.php -->
35-
<?php
30+
live::
3631

32+
// web/app.php
3733
require_once __DIR__.'/../app/AppKernel.php';
3834

35+
use Symfony\Component\HttpFoundation\Request;
36+
3937
$kernel = new AppKernel('prod', false);
40-
$kernel->handle()->send();
38+
$kernel->handle(new Request())->send();
4139

4240
Like any front controller, ``app.php`` uses a Kernel Class, ``AppKernel``, to
4341
bootstrap the application.
@@ -89,15 +87,16 @@ stored in the ``src/`` directory::
8987

9088
$loader = new UniversalClassLoader();
9189
$loader->registerNamespaces(array(
92-
'Symfony' => $vendorDir.'/symfony/src',
93-
'Application' => __DIR__,
94-
'Bundle' => __DIR__,
95-
'Doctrine\\Common' => $vendorDir.'/doctrine-common/lib',
96-
'Doctrine\\DBAL\\Migrations' => $vendorDir.'/doctrine-migrations/lib',
97-
'Doctrine\\ODM\\MongoDB' => $vendorDir.'/doctrine-mongodb/lib',
98-
'Doctrine\\DBAL' => $vendorDir.'/doctrine-dbal/lib',
99-
'Doctrine' => $vendorDir.'/doctrine/lib',
100-
'Zend' => $vendorDir.'/zend/library',
90+
'Symfony' => $vendorDir.'/symfony/src',
91+
'Application' => __DIR__,
92+
'Bundle' => __DIR__,
93+
'Doctrine\\Common\\DataFixtures' => $vendorDir.'/doctrine-data-fixtures/lib',
94+
'Doctrine\\Common' => $vendorDir.'/doctrine-common/lib',
95+
'Doctrine\\DBAL\\Migrations' => $vendorDir.'/doctrine-migrations/lib',
96+
'Doctrine\\ODM\\MongoDB' => $vendorDir.'/doctrine-mongodb/lib',
97+
'Doctrine\\DBAL' => $vendorDir.'/doctrine-dbal/lib',
98+
'Doctrine' => $vendorDir.'/doctrine/lib',
99+
'Zend' => $vendorDir.'/zend/library',
101100
));
102101
$loader->registerPrefixes(array(
103102
'Swift_' => $vendorDir.'/swiftmailer/lib/classes',
@@ -147,7 +146,7 @@ method of the ``AppKernel`` class::
147146
//new Symfony\Bundle\TwigBundle\TwigBundle(),
148147

149148
// register your bundles
150-
new Application\AppBundle\AppBundle(),
149+
new Application\HelloBundle\HelloBundle(),
151150
);
152151

153152
if ($this->isDebug()) {
@@ -179,12 +178,9 @@ PHP. Have a look at the default configuration:
179178
templating:
180179
escaping: htmlspecialchars
181180
#assets_version: SomeVersionScheme
182-
#user:
183-
# default_locale: fr
184-
# session:
185-
# name: SYMFONY
186-
# type: Native
187-
# lifetime: 3600
181+
session:
182+
default_locale: en
183+
lifetime: 3600
188184
189185
## Twig Configuration
190186
#twig.config:
@@ -213,11 +209,7 @@ PHP. Have a look at the default configuration:
213209
<app:router resource="%kernel.root_dir%/config/routing.xml" />
214210
<app:validation enabled="true" annotations="true" />
215211
<app:templating escaping="htmlspecialchars" />
216-
<!--
217-
<app:user default-locale="fr">
218-
<app:session name="SYMFONY" type="Native" lifetime="3600" />
219-
</app:user>
220-
//-->
212+
<app:session default-locale="en" lifetime="3600" />
221213
</app:config>
222214
223215
<!-- Twig Configuration -->
@@ -255,14 +247,10 @@ PHP. Have a look at the default configuration:
255247
'escaping' => 'htmlspecialchars'
256248
#'assets_version' => "SomeVersionScheme",
257249
),
258-
#'user' => array(
259-
# 'default_locale' => "fr",
260-
# 'session' => array(
261-
# 'name' => "SYMFONY",
262-
# 'type' => "Native",
263-
# 'lifetime' => "3600",
264-
# )
265-
#),
250+
'session' => array(
251+
'default_locale' => "en",
252+
'lifetime' => "3600",
253+
),
266254
));
267255
268256
// Twig Configuration
@@ -316,7 +304,7 @@ specific configuration file:
316304
zend.config:
317305
logger:
318306
priority: debug
319-
path: %kernel.root_dir%/logs/%kernel.environment%.log
307+
path: %kernel.logs_dir%/%kernel.environment%.log
320308
321309
.. code-block:: xml
322310

quick_tour/the_big_picture.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ The controller is responsible for returning a representation of the resource
230230
}
231231
}
232232
233-
234233
The code is pretty straightforward but let's explain this code line by line:
235234

236235
* *line 3*: Symfony2 takes advantage of new PHP 5.3 features and as such, all

0 commit comments

Comments
 (0)