4
4
Installing the Symfony CMF Standard Edition
5
5
===========================================
6
6
7
- The goal of this tutorial is to install all the CMF components with the minimum necessary
8
- configuration and some very simple examples into a working Symfony2 application. This can
9
- be used to familiarize yourself with the CMF or to be used as a starting point for a new
10
- custom application.
7
+ The goal of this tutorial is to install all the CMF components with the
8
+ minimum necessary configuration and some very simple examples into a working
9
+ Symfony2 application. This can be used to familiarize yourself with the CMF or
10
+ to be used as a starting point for a new custom application.
11
11
12
- If this is your first encounter with the Symfony CMF it would be a good idea to first take a
13
- look at:
12
+ If this is your first encounter with the Symfony CMF it would be a good idea
13
+ to first take a look at:
14
14
15
- - `The Big Picture `_
16
- - The online sandbox demo at `cmf.liip.ch `_
15
+ * `The Big Picture `_
16
+ * The online sandbox demo at `cmf.liip.ch `_
17
17
18
18
.. note ::
19
19
20
20
For other Symfony CMF installation guides, please read:
21
21
22
- * The cookbook entry on :doc: `../cookbook/installing-cmf-sandbox ` for instructions on
23
- how to install a more complete demo instance of Symfony CMF.
24
- * :doc: `../tutorials/installing-cmf-core ` for step-by-step installation and
25
- configuration details of just the core components into an existing Symfony
26
- application.
22
+ * The cookbook entry on :doc: `../cookbook/installing-cmf-sandbox ` for
23
+ instructions on how to install a more complete demo instance of Symfony
24
+ CMF.
25
+ * :doc: `../tutorials/installing-cmf-core ` for step-by-step installation
26
+ and configuration details of just the core components into an existing
27
+ Symfony application.
27
28
28
29
Preconditions
29
30
-------------
30
31
31
32
As Symfony CMF is based on Symfony2, you should make sure you meet the
32
- `Requirements for running Symfony2 `_.
33
- Additionally, you need to have ` SQLite `_ PDO extension (``pdo_sqlite ``)
34
- installed, since it is used as the default storage medium.
33
+ `Requirements for running Symfony2 `_. Additionally, you need to have ` SQLite `_
34
+ PDO extension (``pdo_sqlite ``) installed, since it is used as the default
35
+ storage medium.
35
36
36
37
.. note ::
37
38
38
- By default, Symfony CMF uses Jackalope + Doctrine DBAL and SQLite as
39
- the underlying DB. However, Symfony CMF is storage agnostic, which means
40
- you can use one of several available data storage mechanisms without
41
- having to rewrite your code. For more information on the different
42
- available mechanisms and how to install and configure them, refer to
39
+ By default, Symfony CMF uses Jackalope + Doctrine DBAL and SQLite as the
40
+ underlying DB. However, Symfony CMF is storage agnostic, which means you
41
+ can use one of several available data storage mechanisms without having to
42
+ rewrite your code. For more information on the different available
43
+ mechanisms and how to install and configure them, refer to
43
44
:doc: `../tutorials/installing-configuring-doctrine-phpcr-odm `
44
45
45
- `Git `_ and `Curl `_ are also needed to follow the installation steps listed below.
46
-
46
+ `Git `_ and `Curl `_ are also needed to follow the installation steps listed
47
+ below.
47
48
48
49
Installation
49
50
------------
@@ -64,14 +65,15 @@ and then get the Symfony CMF code with it (this may take a while)
64
65
65
66
.. note ::
66
67
67
- The path ``<path-to-install> `` should either inside your web server doc root or
68
- configure a virtual host for ``<path-to-install> ``.
68
+ The path ``<path-to-install> `` should either inside your web server doc
69
+ root or configure a virtual host for ``<path-to-install> ``.
69
70
70
- This will clone the standard edition and install all the dependencies and run some initial commands.
71
- These commands require write permissions to the ``app/cache `` and ``app/logs `` directory. In case
72
- the final commands end up giving permissions errors, please follow the
73
- `guidelines in the symfony book `_ for configuring the permissions and then run the
74
- ``composer.phar install `` command mentioned below.
71
+ This will clone the standard edition and install all the dependencies and run
72
+ some initial commands. These commands require write permissions to the
73
+ ``app/cache `` and ``app/logs `` directory. In case the final commands end up
74
+ giving permissions errors, please follow the `guidelines in the symfony book `_
75
+ for configuring the permissions and then run the ``composer.phar install ``
76
+ command mentioned below.
75
77
76
78
If you prefer you can also just clone the project:
77
79
@@ -80,15 +82,16 @@ If you prefer you can also just clone the project:
80
82
$ git clone git://github.com/symfony-cmf/symfony-cmf-standard.git < dir-name>
81
83
$ cd < dir-name>
82
84
83
- If there were problems during the ``create-project `` command, or if you used ``git clone `` or if you
84
- updated the checkout later, always run the following command to update the dependencies:
85
+ If there were problems during the ``create-project `` command, or if you used
86
+ ``git clone `` or if you updated the checkout later, always run the following
87
+ command to update the dependencies:
85
88
86
89
.. code-block :: bash
87
90
88
91
$ php composer.phar install
89
92
90
- The next step is to setup the database, if you want to use SQLite as your database backend just go
91
- ahead and run the following:
93
+ The next step is to setup the database, if you want to use SQLite as your
94
+ database backend just go ahead and run the following:
92
95
93
96
.. code-block :: bash
94
97
@@ -97,10 +100,11 @@ ahead and run the following:
97
100
$ php app/console doctrine:phpcr:repository:init
98
101
$ php app/console doctrine:phpcr:fixtures:load
99
102
100
- This will create a file called ``app.sqlite `` inside your app folder, containing the database content.
103
+ This will create a file called ``app.sqlite `` inside your app folder,
104
+ containing the database content.
101
105
102
- The project should now be accessible on your web server. If you have PHP 5.4 installed
103
- you can alternatively use the PHP internal web server:
106
+ The project should now be accessible on your web server. If you have PHP 5.4
107
+ installed you can alternatively use the PHP internal web server:
104
108
105
109
.. code-block :: bash
106
110
@@ -112,57 +116,63 @@ And then access the CMF via:
112
116
113
117
http://localhost:8000
114
118
115
- If you prefer to use another database backend, for example MySQL, run the configurator (point your browser
116
- to ``/web/config.php ``) or set your database connection parameters in ``app/config/parameters.yml ``. Make sure you
117
- leave the ``database_path `` property at ``null `` in order to use another driver than SQLite. Leaving the field blank
118
- in the web-configurator should set it to ``null ``.
119
+ If you prefer to use another database backend, for example MySQL, run the
120
+ configurator (point your browser to ``/web/config.php ``) or set your database
121
+ connection parameters in ``app/config/parameters.yml ``. Make sure you leave
122
+ the ``database_path `` property at ``null `` in order to use another driver than
123
+ SQLite. Leaving the field blank in the web-configurator should set it to
124
+ ``null ``.
119
125
120
126
Overview
121
127
--------
122
128
123
129
This guide will help you understand the basic parts of Symfony CMF Standard
124
- Edition (SE) and how they work together to provide the default pages you
125
- can see when browsing the Symfony CMF SE installation.
130
+ Edition (SE) and how they work together to provide the default pages you can
131
+ see when browsing the Symfony CMF SE installation.
126
132
127
- It assumes you have already installed Symfony CMF SE and have carefully
128
- read `the Symfony2 book `_.
133
+ It assumes you have already installed Symfony CMF SE and have carefully read
134
+ `the Symfony2 book `_.
129
135
130
136
.. note ::
131
137
132
138
For other Symfony CMF installation guides, please read:
133
139
134
- * The cookbook entry on :doc: `../cookbook/installing-cmf-sandbox ` for instructions on how to
135
- install a more complete demo instance of Symfony CMF.
136
- * :doc: `../tutorials/installing-cmf-core ` for step-by-step installation and configuration
137
- details of just the core components into an existing Symfony application.
140
+ * The cookbook entry on :doc: `../cookbook/installing-cmf-sandbox ` for
141
+ instructions on how to install a more complete demo instance of Symfony
142
+ CMF.
143
+ * :doc: `../tutorials/installing-cmf-core ` for step-by-step installation
144
+ and configuration details of just the core components into an existing
145
+ Symfony application.
138
146
139
147
AcmeMainBundle and SimpleCMSBundle
140
148
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
141
149
142
- Symfony CMF SE comes with a default AcmeMainBundle to help you get started,
143
- in a similar way that Symfony2 has AcmeDemoBundle, providing you some
144
- demo pages visible on your browser. However, AcmeMainBundle doesn't include
145
- controllers or configuration files, like you probably would expect. It contains
146
- little more than a twig file and `Fixtures `_ data, that was loaded into your
147
- database during installation.
150
+ Symfony CMF SE comes with a default AcmeMainBundle to help you get started, in
151
+ a similar way that Symfony2 has AcmeDemoBundle, providing you some demo pages
152
+ visible on your browser. However, AcmeMainBundle doesn't include controllers
153
+ or configuration files, like you probably would expect. It contains little
154
+ more than a twig file and `Fixtures `_ data, that was loaded into your database
155
+ during installation.
148
156
149
157
There are several bundles working together in order to turn the fixture data
150
158
into a browsable website. The overall, simplified process is:
151
159
152
- * When a request is received, the :doc: `Symfony CMF Routing's Dynamic Router <routing >` is used
153
- to handle the incoming request;
154
- * The Dynamic Router is able to match the requested URL with a specific ContentBundle's Content
155
- stored in the database;
156
- * The retrieved content's information is used to determine which controller to pass it on to, and
157
- which template to use;
160
+ * When a request is received, the :doc: `Symfony CMF Routing's Dynamic Router <routing >`
161
+ is used to handle the incoming request;
162
+ * The Dynamic Router is able to match the requested URL with a specific
163
+ ContentBundle's Content stored in the database;
164
+ * The retrieved content's information is used to determine which controller to
165
+ pass it on to, and which template to use;
158
166
* As configured, the retrieved content is passed to ContentBundle's
159
- ``ContentController ``, which will handle it and render AcmeMainBundle's ``layout.html.twig ``.
167
+ ``ContentController ``, which will handle it and render AcmeMainBundle's
168
+ ``layout.html.twig ``.
160
169
161
- Again, this is simplified view of a very simple CMS built on top of Symfony CMF.
162
- To fully understand all the possibilities of the CMF, a careful look into
163
- each component is needed.
170
+ Again, this is simplified view of a very simple CMS built on top of Symfony
171
+ CMF. To fully understand all the possibilities of the CMF, a careful look
172
+ into each component is needed.
164
173
165
- If you want to review the contents of the PHPCR database you can use the following command:
174
+ If you want to review the contents of the PHPCR database you can use the
175
+ following command:
166
176
167
177
.. code-block :: bash
168
178
@@ -171,21 +181,25 @@ If you want to review the contents of the PHPCR database you can use the followi
171
181
Adding new pages
172
182
~~~~~~~~~~~~~~~~
173
183
174
- Symfony CMF SE does not provide any admin tools to create new pages. If you are interested in adding
175
- an admin UI have a look at :doc: `../tutorials/creating-cms-using-cmf-and-sonata `. However if all you
176
- want is a simple way to add new pages that you can then edit via the inline editing, then you can
177
- use the SimpleCmsBundle ``page `` migrator. The Symfony CMF SE ships with an example yaml file stored
178
- in ``app/Resources/data/pages/test.yml ``. The contents of this file can be loaded into the PHPCR
179
- database by calling:
184
+ Symfony CMF SE does not provide any admin tools to create new pages. If you
185
+ are interested in adding an admin UI have a look at
186
+ :doc: `../tutorials/creating-cms-using-cmf-and-sonata `. However if all you want
187
+ is a simple way to add new pages that you can then edit via the inline
188
+ editing, then you can use the SimpleCmsBundle ``page `` migrator. The Symfony
189
+ CMF SE ships with an example yaml file stored in
190
+ ``app/Resources/data/pages/test.yml ``. The contents of this file can be loaded
191
+ into the PHPCR database by calling:
180
192
181
193
.. code-block :: bash
182
194
183
195
$ php app/console doctrine:phpcr:migrator page --identifier=/cms/simple/test
184
196
185
- Note that the above identifier is mapped to ``app/Resources/data/pages/test.yml `` by stripping
186
- off the ``basepath `` configuration of the SimpleCmsBundle, which defaults to ``/cms/simple ``.
187
- Therefore if you want to define a child page ``foo `` for ``/cms/simple/test `` you would need to
188
- create a file ````app/Resources/data/pages/test/foo.yml `` and then run the following command:
197
+ Note that the above identifier is mapped to
198
+ ``app/Resources/data/pages/test.yml `` by stripping off the ``basepath ``
199
+ configuration of the SimpleCmsBundle, which defaults to ``/cms/simple ``.
200
+ Therefore if you want to define a child page ``foo `` for ``/cms/simple/test ``
201
+ you would need to create a file ``app/Resources/data/pages/test/foo.yml ``
202
+ and then run the following command:
189
203
190
204
.. code-block :: bash
191
205
0 commit comments