Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a067cba

Browse filesBrowse files
committed
Merge branch '2.1'
Conflicts: reference/configuration/framework.rst
2 parents 8a8ea6f + 989073d commit a067cba
Copy full SHA for a067cba

File tree

Expand file treeCollapse file tree

18 files changed

+263
-63
lines changed
Filter options
Expand file treeCollapse file tree

18 files changed

+263
-63
lines changed

‎book/doctrine.rst

Copy file name to clipboardExpand all lines: book/doctrine.rst
+53-4Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ for you:
8888
8989
$ php app/console doctrine:database:create
9090
91-
.. sidebar:: Setting Up The Database
91+
.. sidebar:: Setting Up The Database to be UTF8
9292

9393
One mistake even seasoned developers make when starting a Symfony2 project
9494
is forgetting to setup default charset and collation on their database,
@@ -114,6 +114,45 @@ for you:
114114
collation-server = utf8_general_ci
115115
character-set-server = utf8
116116
117+
Using SQLite
118+
~~~~~~~~~~~~
119+
120+
If you want to use SQLite as your database, you need to set the path
121+
where your database file should be stored:
122+
123+
.. configuration-block::
124+
125+
.. code-block:: yaml
126+
127+
# app/config/config.yml
128+
doctrine:
129+
dbal:
130+
driver: pdo_sqlite
131+
path: "%kernel.root_dir%/sqlite.db"
132+
charset: UTF8
133+
134+
.. code-block:: xml
135+
136+
<!-- app/config/config.xml -->
137+
<doctrine:config
138+
driver="pdo_sqlite"
139+
path="%kernel.root_dir%/sqlite.db"
140+
charset="UTF-8"
141+
>
142+
<!-- ... -->
143+
</doctrine:config>
144+
145+
.. code-block:: php
146+
147+
// app/config/config.php
148+
$container->loadFromExtension('doctrine', array(
149+
'dbal' => array(
150+
'driver' => 'pdo_sqlite',
151+
'path' => '%kernel.root_dir%/sqlite.db',
152+
'charset' => 'UTF-8',
153+
),
154+
));
155+
117156
Creating an Entity Class
118157
~~~~~~~~~~~~~~~~~~~~~~~~
119158

@@ -317,8 +356,8 @@ doesn't replace your existing methods).
317356

318357
.. caution::
319358

320-
Keep in mind that Doctrine's entity generator produces simple getters/setters.
321-
You should check generated entities and adjust getter/setter logic to your own
359+
Keep in mind that Doctrine's entity generator produces simple getters/setters.
360+
You should check generated entities and adjust getter/setter logic to your own
322361
needs.
323362

324363
.. sidebar:: More about ``doctrine:generate:entities``
@@ -1370,7 +1409,7 @@ without any arguments:
13701409
13711410
$ php app/console
13721411
1373-
A list of available command will print out, many of which start with the
1412+
A list of available commands will print out, many of which start with the
13741413
``doctrine:`` prefix. You can find out more information about any of these
13751414
commands (or any Symfony command) by running the ``help`` command. For example,
13761415
to get details about the ``doctrine:database:create`` task, run:
@@ -1406,6 +1445,16 @@ Some notable or interesting tasks include:
14061445
read the ":doc:`/bundles/DoctrineFixturesBundle/index`" entry of the
14071446
documentation.
14081447

1448+
.. tip::
1449+
1450+
This page shows working with Doctrine within a controller. You may also
1451+
want to work with Doctrine elsewhere in your application. The
1452+
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::getDoctrine`
1453+
method of the controller returns the ``doctrine`` service, you can work with
1454+
this in the same way elsewhere by injecting this into your own
1455+
services. See :doc:`/book/service_container` for more on creating
1456+
your own services.
1457+
14091458
Summary
14101459
-------
14111460

‎book/page_creation.rst

Copy file name to clipboardExpand all lines: book/page_creation.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ options of each feature.
803803
disadvantages. The choice of which to use is up to you:
804804

805805
* *YAML*: Simple, clean and readable (learn more about yaml in
806-
* ":doc:`/components/yaml/yaml_format`");
806+
":doc:`/components/yaml/yaml_format`");
807807

808808
* *XML*: More powerful than YAML at times and supports IDE autocompletion;
809809

‎book/security.rst

Copy file name to clipboardExpand all lines: book/security.rst
+16-16Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ First, enable form login under your firewall:
296296
pattern: ^/
297297
anonymous: ~
298298
form_login:
299-
login_path: /login
300-
check_path: /login_check
299+
login_path: login
300+
check_path: login_check
301301
302302
.. code-block:: xml
303303
@@ -313,7 +313,7 @@ First, enable form login under your firewall:
313313
<config>
314314
<firewall name="secured_area" pattern="^/">
315315
<anonymous />
316-
<form-login login_path="/login" check_path="/login_check" />
316+
<form-login login_path="login" check_path="login_check" />
317317
</firewall>
318318
</config>
319319
</srv:container>
@@ -327,8 +327,8 @@ First, enable form login under your firewall:
327327
'pattern' => '^/',
328328
'anonymous' => array(),
329329
'form_login' => array(
330-
'login_path' => '/login',
331-
'check_path' => '/login_check',
330+
'login_path' => 'login',
331+
'check_path' => 'login_check',
332332
),
333333
),
334334
),
@@ -355,10 +355,11 @@ First, enable form login under your firewall:
355355
'form_login' => array(),
356356
357357
Now, when the security system initiates the authentication process, it will
358-
redirect the user to the login form (``/login`` by default). Implementing
359-
this login form visually is your job. First, create two routes: one that
360-
will display the login form (i.e. ``/login``) and one that will handle the
361-
login form submission (i.e. ``/login_check``):
358+
redirect the user to the login form (``/login`` by default). Implementing this
359+
login form visually is your job. First, the create two routes we used in the
360+
security configuration: the ``login`` route will display the login form (i.e.
361+
``/login``) and the ``login_check`` route will handle the login form
362+
submission (i.e. ``/login_check``):
362363

363364
.. configuration-block::
364365

@@ -408,12 +409,11 @@ login form submission (i.e. ``/login_check``):
408409
to this URL.
409410

410411
.. versionadded:: 2.1
411-
As of Symfony 2.1, you *must* have routes configured for your ``login_path``
412-
(e.g. ``/login``), ``check_path`` (e.g. ``/login_check``) and ``logout``
413-
(e.g. ``/logout`` - see `Logging Out`_) URLs.
412+
As of Symfony 2.1, you *must* have routes configured for your ``login_path``,
413+
``check_path`` ``logout`` keys. These keys can be route names (as shown
414+
in this example) or URLs that have routes configured for them.
414415

415-
Notice that the name of the ``login`` route isn't important. What's important
416-
is that the URL of the route (``/login``) matches the ``login_path`` config
416+
Notice that the name of the ``login`` route matches the``login_path`` config
417417
value, as that's where the security system will redirect users that need
418418
to login.
419419

@@ -557,7 +557,7 @@ see :doc:`/cookbook/security/form_login`.
557557

558558
**1. Create the correct routes**
559559

560-
First, be sure that you've defined the ``/login`` and ``/login_check``
560+
First, be sure that you've defined the ``login`` and ``login_check``
561561
routes correctly and that they correspond to the ``login_path`` and
562562
``check_path`` config values. A misconfiguration here can mean that you're
563563
redirected to a 404 page instead of the login page, or that submitting
@@ -1671,7 +1671,7 @@ the firewall can handle this automatically for you when you activate the
16711671
'firewalls' => array(
16721672
'secured_area' => array(
16731673
// ...
1674-
'logout' => array('path' => 'logout', 'target' => '/'),
1674+
'logout' => array('path' => '/logout', 'target' => '/'),
16751675
),
16761676
),
16771677
// ...

‎book/translation.rst

Copy file name to clipboardExpand all lines: book/translation.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ override the translation messages of a bundle in any of the top 2 directories.
303303

304304
The override mechanism works at a key level: only the overridden keys need
305305
to be listed in a higher priority message file. When a key is not found
306-
in a message file, the translator will automatically fallback to the lower
306+
in a message file, the translator will automatically fall back to the lower
307307
priority message files.
308308

309309
The filename of the translations is also important as Symfony2 uses a convention
@@ -996,7 +996,7 @@ steps:
996996
a specific convention;
997997

998998
* Manage the user's locale, which is stored on the request, but can also
999-
be set once the user's session.
999+
be set on the user's session.
10001000

10011001
.. _`i18n`: http://en.wikipedia.org/wiki/Internationalization_and_localization
10021002
.. _`L10n`: http://en.wikipedia.org/wiki/Internationalization_and_localization

‎components/config/definition.rst

Copy file name to clipboardExpand all lines: components/config/definition.rst
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.. index::
2-
single: Config; Define and process configuration values
2+
single: Config; Defining and processing configuration values
33

4-
Define and process configuration values
5-
=======================================
4+
Defining and processing configuration values
5+
============================================
66

7-
Validate configuration values
8-
-----------------------------
7+
Validating configuration values
8+
-------------------------------
99

1010
After loading configuration values from all kinds of resources, the values
1111
and their structure can be validated using the "Definition" part of the Config
@@ -38,8 +38,8 @@ they are when first encountered. Also, some keys are only available when
3838
another key has a specific value (in the sample configuration above: the
3939
``memory`` key only makes sense when the ``driver`` is ``sqlite``).
4040

41-
Define a hierarchy of configuration values using the TreeBuilder
42-
----------------------------------------------------------------
41+
Defining a hierarchy of configuration values using the TreeBuilder
42+
------------------------------------------------------------------
4343

4444
All the rules concerning configuration values can be defined using the
4545
:class:`Symfony\\Component\\Config\\Definition\\Builder\\TreeBuilder`.
@@ -66,8 +66,8 @@ should be returned from a custom ``Configuration`` class which implements the
6666
}
6767
}
6868

69-
Add node definitions to the tree
70-
--------------------------------
69+
Adding node definitions to the tree
70+
-----------------------------------
7171

7272
Variable nodes
7373
~~~~~~~~~~~~~~

‎components/console/single_command_tool.rst

Copy file name to clipboardExpand all lines: components/console/single_command_tool.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. index::
22
single: Console; Single command application
33

4-
How to build an Application that is a single Command
5-
====================================================
4+
Building a Single Command Application
5+
=====================================
66

77
When building a command line tool, you may not need to provide several commands.
88
In such case, having to pass the command name each time is tedious. Fortunately,

‎cookbook/console/console_command.rst

Copy file name to clipboardExpand all lines: cookbook/console/console_command.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ should be used instead of :class:`Symfony\\Component\\Console\\Application`::
112112

113113
To be able to use the fully set up service container for your console tests
114114
you can extend your test from
115-
:class:`Symfony\Bundle\FrameworkBundle\Test\WebTestCase`::
115+
:class:`Symfony\\Bundle\\FrameworkBundle\\Test\\WebTestCase`::
116116

117117
use Symfony\Component\Console\Tester\CommandTester;
118118
use Symfony\Bundle\FrameworkBundle\Console\Application;

‎cookbook/email/gmail.rst

Copy file name to clipboardExpand all lines: cookbook/email/gmail.rst
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ In the development configuration file, change the ``transport`` setting to
5151
5252
You're done!
5353

54+
.. tip::
55+
56+
If you are using the Symfony Standard Edition, configure the parameters at ``parameters.yml``:
57+
58+
.. code-block:: yaml
59+
60+
# app/config/parameters.yml
61+
parameters:
62+
...
63+
mailer_transport: gmail
64+
mailer_host: ~
65+
mailer_user: your_gmail_username
66+
mailer_password: your_gmail_password
67+
5468
.. note::
5569

5670
The ``gmail`` transport is simply a shortcut that uses the ``smtp`` transport

‎quick_tour/the_architecture.rst

Copy file name to clipboardExpand all lines: quick_tour/the_architecture.rst
+11-12Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,16 @@ PHP. Have a look at the default configuration:
140140
#esi: ~
141141
#translator: { fallback: "%locale%" }
142142
secret: "%secret%"
143-
router: { resource: "%kernel.root_dir%/config/routing.yml" }
143+
router:
144+
resource: "%kernel.root_dir%/config/routing.yml"
145+
strict_requirements: "%kernel.debug%"
144146
form: true
145147
csrf_protection: true
146148
validation: { enable_annotations: true }
147149
templating: { engines: ['twig'] } #assets_version: SomeVersionScheme
148150
default_locale: "%locale%"
149-
session:
150-
auto_start: true
151+
trusted_proxies: ~
152+
session: ~
151153
152154
# Twig Configuration
153155
twig:
@@ -159,13 +161,13 @@ PHP. Have a look at the default configuration:
159161
debug: "%kernel.debug%"
160162
use_controller: false
161163
bundles: [ ]
162-
# java: /usr/bin/java
164+
#java: /usr/bin/java
163165
filters:
164166
cssrewrite: ~
165-
# closure:
166-
# jar: "%kernel.root_dir%/java/compiler.jar"
167-
# yui_css:
168-
# jar: "%kernel.root_dir%/java/yuicompressor-2.4.2.jar"
167+
#closure:
168+
# jar: "%kernel.root_dir%/Resources/java/compiler.jar"
169+
#yui_css:
170+
# jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
169171
170172
# Doctrine Configuration
171173
doctrine:
@@ -188,10 +190,7 @@ PHP. Have a look at the default configuration:
188190
host: "%mailer_host%"
189191
username: "%mailer_user%"
190192
password: "%mailer_password%"
191-
192-
jms_security_extra:
193-
secure_controllers: true
194-
secure_all_services: false
193+
spool: { type: memory }
195194
196195
Each entry like ``framework`` defines the configuration for a specific bundle.
197196
For example, ``framework`` configures the ``FrameworkBundle`` while ``swiftmailer``

‎reference/configuration/assetic.rst

Copy file name to clipboardExpand all lines: reference/configuration/assetic.rst
+49Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,52 @@ Full Default Configuration
5252
functions:
5353
# An array of named functions (e.g. some_function, some_other_function)
5454
some_function: []
55+
56+
.. code-block:: xml
57+
58+
<assetic:config
59+
debug="%kernel.debug%"
60+
use-controller="%kernel.debug%"
61+
read-from="%kernel.root_dir%/../web"
62+
write-to="%assetic.read_from%"
63+
java="/usr/bin/java"
64+
node="/usr/bin/node"
65+
sass="/usr/bin/sass"
66+
>
67+
<!-- Defaults (all currently registered bundles) -->
68+
<assetic:bundle>FrameworkBundle</assetic:bundle>
69+
<assetic:bundle>SecurityBundle</assetic:bundle>
70+
<assetic:bundle>TwigBundle</assetic:bundle>
71+
<assetic:bundle>MonologBundle</assetic:bundle>
72+
<assetic:bundle>SwiftmailerBundle</assetic:bundle>
73+
<assetic:bundle>DoctrineBundle</assetic:bundle>
74+
<assetic:bundle>AsseticBundle</assetic:bundle>
75+
<assetic:bundle>...</assetic:bundle>
76+
77+
<assetic:asset>
78+
<!-- prototype -->
79+
<assetic:name>
80+
<assetic:input />
81+
82+
<assetic:filter />
83+
84+
<assetic:option>
85+
<!-- prototype -->
86+
<assetic:name />
87+
</assetic:option>
88+
</assetic:name>
89+
</assetic:asset>
90+
91+
<assetic:filter>
92+
<!-- prototype -->
93+
<assetic:name />
94+
</assetic:filter>
95+
96+
<assetic:twig>
97+
<assetic:functions>
98+
<!-- prototype -->
99+
<assetic:name />
100+
</assetic:functions>
101+
</assetic:twig>
102+
103+
</assetic:config>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.