@@ -16,8 +16,7 @@ The directory structure of a Symfony :term:`application` is rather flexible
16
16
but the directory structure of a sandbox reflects the typical and recommended
17
17
structure of a Symfony application:
18
18
19
- * ``hello/ ``: This directory, named after your application, contains the
20
- configuration files;
19
+ * ``app/ ``: This directory contains the application configuration;
21
20
22
21
* ``src/ ``: All the PHP code is stored under this directory;
23
22
@@ -35,22 +34,22 @@ live:
35
34
<!-- web/index.php -->
36
35
<?php
37
36
38
- require_once __DIR__.'/../hello/HelloKernel .php';
37
+ require_once __DIR__.'/../app/AppKernel .php';
39
38
40
- $kernel = new HelloKernel ('prod', false);
39
+ $kernel = new AppKernel ('prod', false);
41
40
$kernel->handle()->send();
42
41
43
- Like any front controller, ``index.php `` uses a Kernel Class, ``HelloKernel ``, to
44
- bootstrap the application.
42
+ Like any front controller, ``index.php `` uses a Kernel Class, ``AppKernel ``,
43
+ to bootstrap the application.
45
44
46
45
.. index ::
47
46
single: Kernel
48
47
49
48
The Application Directory
50
49
~~~~~~~~~~~~~~~~~~~~~~~~~
51
50
52
- The ``HelloKernel `` class is the main entry point of the application
53
- configuration and as such, it is stored in the ``hello / `` directory.
51
+ The ``AppKernel `` class is the main entry point of the application
52
+ configuration and as such, it is stored in the ``app / `` directory.
54
53
55
54
This class must implement four methods:
56
55
@@ -72,7 +71,7 @@ understand the flexibility of the framework.
72
71
To make things work together, the kernel requires one file from the ``src/ ``
73
72
directory::
74
73
75
- // hello/HelloKernel .php
74
+ // app/AppKernel .php
76
75
require_once __DIR__.'/../src/autoload.php';
77
76
78
77
The Source Directory
@@ -128,14 +127,13 @@ own bundles. It makes it so easy to pick and choose which features to enable
128
127
in your application and optimize them the way you want.
129
128
130
129
An application is made up of bundles as defined in the ``registerBundles() ``
131
- method of the ``HelloKernel `` class::
130
+ method of the ``AppKernel `` class::
132
131
133
- // hello/HelloKernel .php
132
+ // app/AppKernel .php
134
133
135
134
public function registerBundles()
136
135
{
137
136
$bundles = array(
138
- new Symfony\Framework\KernelBundle(),
139
137
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
140
138
new Symfony\Bundle\ZendBundle\ZendBundle(),
141
139
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
@@ -165,7 +163,7 @@ PHP. Have a look at the default configuration:
165
163
166
164
.. code-block :: yaml
167
165
168
- # hello /config/config.yml
166
+ # app /config/config.yml
169
167
kernel.config :
170
168
charset : UTF-8
171
169
error_handler : null
@@ -179,7 +177,7 @@ PHP. Have a look at the default configuration:
179
177
180
178
.. code-block :: xml
181
179
182
- <!-- hello /config/config.xml -->
180
+ <!-- app /config/config.xml -->
183
181
<kernel : config
184
182
charset =" UTF-8"
185
183
error_handler =" null"
@@ -196,7 +194,7 @@ PHP. Have a look at the default configuration:
196
194
197
195
.. code-block :: php
198
196
199
- // hello /config/config.php
197
+ // app /config/config.php
200
198
$container->loadFromExtension('kernel', 'config', array(
201
199
'charset' => 'UTF-8',
202
200
'error_handler' => null,
@@ -223,7 +221,7 @@ specific configuration file:
223
221
224
222
.. code-block :: yaml
225
223
226
- # hello /config/config_dev.yml
224
+ # app /config/config_dev.yml
227
225
imports :
228
226
- { resource: config.yml }
229
227
@@ -236,7 +234,7 @@ specific configuration file:
236
234
237
235
.. code-block :: xml
238
236
239
- <!-- hello /config/config_dev.xml -->
237
+ <!-- app /config/config_dev.xml -->
240
238
<imports >
241
239
<import resource =" config.xml" />
242
240
</imports >
@@ -252,7 +250,7 @@ specific configuration file:
252
250
253
251
.. code-block :: php
254
252
255
- // hello /config/config.php
253
+ // app /config/config.php
256
254
$loader->import('config.php');
257
255
258
256
$container->loadFromExtension('web', 'config', array(
@@ -331,13 +329,13 @@ Run it without any arguments to learn more about its capabilities:
331
329
332
330
.. code-block :: bash
333
331
334
- $ php hello /console
332
+ $ php app /console
335
333
336
334
The ``--help `` option helps you discover the usage of a command:
337
335
338
336
.. code-block :: bash
339
337
340
- $ php hello /console router:debug --help
338
+ $ php app /console router:debug --help
341
339
342
340
Final Thoughts
343
341
--------------
0 commit comments