Skip to content

Commit 2f01d10

Browse files
committed
Merge branch '2.1' into 2.2
2 parents e5cebd3 + b2a3b1d commit 2f01d10

File tree

9 files changed

+79
-62
lines changed

9 files changed

+79
-62
lines changed

book/doctrine.rst

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -142,44 +142,43 @@ for you:
142142
collation-server = utf8_general_ci
143143
character-set-server = utf8
144144
145-
Using SQLite
146-
~~~~~~~~~~~~
145+
.. note::
147146

148-
If you want to use SQLite as your database, you need to set the path
149-
where your database file should be stored:
147+
If you want to use SQLite as your database, you need to set the path
148+
where your database file should be stored:
150149

151-
.. configuration-block::
150+
.. configuration-block::
152151

153-
.. code-block:: yaml
152+
.. code-block:: yaml
154153
155-
# app/config/config.yml
156-
doctrine:
157-
dbal:
158-
driver: pdo_sqlite
159-
path: "%kernel.root_dir%/sqlite.db"
160-
charset: UTF8
154+
# app/config/config.yml
155+
doctrine:
156+
dbal:
157+
driver: pdo_sqlite
158+
path: "%kernel.root_dir%/sqlite.db"
159+
charset: UTF8
161160
162-
.. code-block:: xml
161+
.. code-block:: xml
163162
164-
<!-- app/config/config.xml -->
165-
<doctrine:config
166-
driver="pdo_sqlite"
167-
path="%kernel.root_dir%/sqlite.db"
168-
charset="UTF-8"
169-
>
170-
<!-- ... -->
171-
</doctrine:config>
172-
173-
.. code-block:: php
174-
175-
// app/config/config.php
176-
$container->loadFromExtension('doctrine', array(
177-
'dbal' => array(
178-
'driver' => 'pdo_sqlite',
179-
'path' => '%kernel.root_dir%/sqlite.db',
180-
'charset' => 'UTF-8',
181-
),
182-
));
163+
<!-- app/config/config.xml -->
164+
<doctrine:config
165+
driver="pdo_sqlite"
166+
path="%kernel.root_dir%/sqlite.db"
167+
charset="UTF-8"
168+
>
169+
<!-- ... -->
170+
</doctrine:config>
171+
172+
.. code-block:: php
173+
174+
// app/config/config.php
175+
$container->loadFromExtension('doctrine', array(
176+
'dbal' => array(
177+
'driver' => 'pdo_sqlite',
178+
'path' => '%kernel.root_dir%/sqlite.db',
179+
'charset' => 'UTF-8',
180+
),
181+
));
183182
184183
Creating an Entity Class
185184
~~~~~~~~~~~~~~~~~~~~~~~~

book/propel.rst

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Databases and Propel
77
One of the most common and challenging tasks for any application
88
involves persisting and reading information to and from a database. Symfony2
99
does not come integrated with any ORMs but the Propel integration is easy.
10-
To get started, read `Working With Symfony2`_.
10+
To install Propel, read `Working With Symfony2`_ on the Propel documentation.
1111

1212
A Simple Example: A Product
1313
---------------------------
@@ -28,7 +28,7 @@ Configuring the Database
2828
~~~~~~~~~~~~~~~~~~~~~~~~
2929

3030
Before you can start, you'll need to configure your database connection
31-
information. By convention, this information is usually configured in an
31+
information. By convention, this information is usually configured in an
3232
``app/config/parameters.yml`` file:
3333

3434
.. code-block:: yaml
@@ -48,14 +48,17 @@ information. By convention, this information is usually configured in an
4848
parameters defined in that file are referenced by the main configuration
4949
file when setting up Propel:
5050

51-
.. code-block:: yaml
51+
These parameters defined in ``parameters.yml`` can now be included in the
52+
configuration file (``config.yml``):
5253

53-
propel:
54-
dbal:
55-
driver: "%database_driver%"
56-
user: "%database_user%"
57-
password: "%database_password%"
58-
dsn: "%database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%"
54+
.. code-block:: yaml
55+
56+
propel:
57+
dbal:
58+
driver: "%database_driver%"
59+
user: "%database_user%"
60+
password: "%database_password%"
61+
dsn: "%database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%"
5962
6063
Now that Propel knows about your database, Symfony2 can create the database for
6164
you:
@@ -88,12 +91,28 @@ of your ``AcmeStoreBundle``:
8891
.. code-block:: xml
8992
9093
<?xml version="1.0" encoding="UTF-8"?>
91-
<database name="default" namespace="Acme\StoreBundle\Model" defaultIdMethod="native">
94+
<database name="default"
95+
namespace="Acme\StoreBundle\Model"
96+
defaultIdMethod="native"
97+
>
9298
<table name="product">
93-
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" />
94-
<column name="name" type="varchar" primaryString="true" size="100" />
95-
<column name="price" type="decimal" />
96-
<column name="description" type="longvarchar" />
99+
<column name="id"
100+
type="integer"
101+
required="true"
102+
primaryKey="true"
103+
autoIncrement="true"
104+
/>
105+
<column name="name"
106+
type="varchar"
107+
primaryString="true"
108+
size="100"
109+
/>
110+
<column name="price"
111+
type="decimal"
112+
/>
113+
<column name="description"
114+
type="longvarchar"
115+
/>
97116
</table>
98117
</database>
99118
@@ -217,15 +236,15 @@ have a route that maps a product id to an update action in a controller::
217236

218237
Updating an object involves just three steps:
219238

220-
#. fetching the object from Propel;
221-
#. modifying the object;
222-
#. saving it.
239+
#. fetching the object from Propel (line 6 - 13);
240+
#. modifying the object (line 15);
241+
#. saving it (line 16).
223242

224243
Deleting an Object
225244
~~~~~~~~~~~~~~~~~~
226245

227-
Deleting an object is very similar, but requires a call to the ``delete()``
228-
method on the object::
246+
Deleting an object is very similar to updating, but requires a call to the
247+
``delete()`` method on the object::
229248

230249
$product->delete();
231250

book/service_container.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,8 @@ the framework.
863863

864864
.. tip::
865865

866-
Be sure that ``swiftmailer`` entry appears in your application
867-
configuration. As you mentioned in :ref:`service-container-extension-configuration`,
866+
Be sure that the ``swiftmailer`` entry appears in your application
867+
configuration. As was mentioned in :ref:`service-container-extension-configuration`,
868868
the ``swiftmailer`` key invokes the service extension from the
869869
``SwiftmailerBundle``, which registers the ``mailer`` service.
870870

book/testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ or perform more complex requests::
345345
// Directly submit a form (but using the Crawler is easier!)
346346
$client->request('POST', '/submit', array('name' => 'Fabien'));
347347

348-
// Submit a raw JSON string in the requst body
348+
// Submit a raw JSON string in the request body
349349
$client->request(
350350
'POST',
351351
'/submit',

components/yaml/yaml_format.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Numbers
114114
Nulls
115115
~~~~~
116116

117-
Nulls in YAML can be expressed with ``null`` or ``-``.
117+
Nulls in YAML can be expressed with ``null`` or ``~``.
118118

119119
Booleans
120120
~~~~~~~~
@@ -268,4 +268,4 @@ Comments can be added in YAML by prefixing them with a hash mark (``#``):
268268
Comments are simply ignored by the YAML parser and do not need to be
269269
indented according to the current level of nesting in a collection.
270270

271-
.. _YAML: http://yaml.org/
271+
.. _YAML: http://yaml.org/

contributing/community/irc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ time for at least 4 topics.
1414

1515
.. caution::
1616

17-
Note that its not the expected goal of them meeting to find final
17+
Note that it's not the expected goal of the meeting to find final
1818
solutions, but more to ensure that there is a common understanding of the
1919
issue at hand and move the discussion forward in ways which are hard to
2020
achieve with less real time communication tools.

cookbook/doctrine/file_uploads.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ object, which is what's returned after a ``file`` field is submitted::
321321
$this->path = $this->getFile()->getClientOriginalName();
322322

323323
// clean up the file property as you won't need it anymore
324-
$this->setFile(null);
324+
$this->file = null;
325325
}
326326

327327
Using Lifecycle Callbacks
@@ -407,15 +407,14 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
407407
// the entity from being persisted to the database on error
408408
$this->getFile()->move($this->getUploadRootDir(), $this->path);
409409

410-
$this->setFile(null);
411-
412410
// check if we have an old image
413411
if (isset($this->temp)) {
414412
// delete the old image
415413
unlink($this->getUploadRootDir().'/'.$this->temp);
416414
// clear the temp image path
417415
$this->temp = null;
418416
}
417+
$this->file = null;
419418
}
420419

421420
/**

cookbook/form/form_collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Allowing "new" tags with the "prototype"
274274

275275
Allowing the user to dynamically add new tags means that you'll need to
276276
use some JavaScript. Previously you added two tags to your form in the controller.
277-
Now to let the user add as many tag forms as he needs directly in the browser.
277+
Now let the user add as many tag forms as he needs directly in the browser.
278278
This will be done through a bit of JavaScript.
279279

280280
The first thing you need to do is to let the form collection know that it will

reference/forms/twig_reference.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ object:
220220

221221
<label for="{{ form.name.vars.id }}"
222222
class="{{ form.name.vars.required ? 'required' : '' }}">
223-
{{ form.name.label }}
223+
{{ form.name.vars.label }}
224224
</label>
225225

226226
.. code-block:: html+php

0 commit comments

Comments
 (0)