@@ -27,17 +27,15 @@ The Web Directory
27
27
28
28
The web root directory is the home of all public and static files like images,
29
29
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::
36
31
32
+ // web/app.php
37
33
require_once __DIR__.'/../app/AppKernel.php';
38
34
35
+ use Symfony\Component\HttpFoundation\Request;
36
+
39
37
$kernel = new AppKernel('prod', false);
40
- $kernel->handle()->send();
38
+ $kernel->handle(new Request() )->send();
41
39
42
40
Like any front controller, ``app.php `` uses a Kernel Class, ``AppKernel ``, to
43
41
bootstrap the application.
@@ -89,15 +87,16 @@ stored in the ``src/`` directory::
89
87
90
88
$loader = new UniversalClassLoader();
91
89
$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',
101
100
));
102
101
$loader->registerPrefixes(array(
103
102
'Swift_' => $vendorDir.'/swiftmailer/lib/classes',
@@ -147,7 +146,7 @@ method of the ``AppKernel`` class::
147
146
//new Symfony\Bundle\TwigBundle\TwigBundle(),
148
147
149
148
// register your bundles
150
- new Application\AppBundle\AppBundle (),
149
+ new Application\HelloBundle\HelloBundle (),
151
150
);
152
151
153
152
if ($this->isDebug()) {
@@ -179,12 +178,9 @@ PHP. Have a look at the default configuration:
179
178
templating :
180
179
escaping : htmlspecialchars
181
180
# 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
188
184
189
185
# # Twig Configuration
190
186
# twig.config:
@@ -213,11 +209,7 @@ PHP. Have a look at the default configuration:
213
209
<app : router resource =" %kernel.root_dir%/config/routing.xml" />
214
210
<app : validation enabled =" true" annotations =" true" />
215
211
<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" />
221
213
</app : config >
222
214
223
215
<!-- Twig Configuration -->
@@ -255,14 +247,10 @@ PHP. Have a look at the default configuration:
255
247
'escaping' => 'htmlspecialchars'
256
248
#'assets_version' => "SomeVersionScheme",
257
249
),
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
+ ),
266
254
));
267
255
268
256
// Twig Configuration
@@ -316,7 +304,7 @@ specific configuration file:
316
304
zend.config :
317
305
logger :
318
306
priority : debug
319
- path : %kernel.root_dir%/logs /%kernel.environment%.log
307
+ path : %kernel.logs_dir% /%kernel.environment%.log
320
308
321
309
.. code-block :: xml
322
310
0 commit comments