8000 Merge branch '2.0' · mehdimabrouk/symfony-docs@dcb7904 · GitHub
[go: up one dir, main page]

Skip to content

Commit dcb7904

Browse files
committed
Merge branch '2.0'
2 parents 58f723f + e39f5a8 commit dcb7904

File tree

19 files changed

+252
-43
lines changed

19 files changed

+252
-43
lines changed

book/from_flat_php_to_symfony2.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ them for you. Here's the same sample application, now built in Symfony2:
555555
->createQuery('SELECT p FROM AcmeBlogBundle:Post p')
556556
->execute();
557557

558-
return $this->render('AcmeBlogBundle:Post:list.html.php', array('posts' => $posts));
558+
return $this->render('AcmeBlogBundle:Blog:list.html.php', array('posts' => $posts));
559559
}
560560

561561
public function showAction($id)
@@ -570,7 +570,7 @@ them for you. Here's the same sample application, now built in Symfony2:
570570
throw $this->createNotFoundException();
571571
}
572572

573-
return $this->render('AcmeBlogBundle:Post:show.html.php', array('post' => $post));
573+
return $this->render('AcmeBlogBundle:Blog:show.html.php', array('post' => $post));
574574
}
575575
}
576576

book/security.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Basic Example: HTTP Authentication
2828
----------------------------------
2929

3030
The security component can be configured via your application configuration.
31-
In fact, most standard security setups are just matter of using the right
31+
In fact, most standard security setups are just a matter of using the right
3232
configuration. The following configuration tells Symfony to secure any URL
3333
matching ``/admin/*`` and to ask the user for credentials using basic HTTP
3434
authentication (i.e. the old-school username/password box):

book/testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Running tests for a given file or directory is also very easy:
9898
# run all tests in the Utility directory
9999
$ phpunit -c app src/Acme/DemoBundle/Tests/Utility/
100100
101-
# run tests for the Article class
101+
# run tests for the Calculator class
102102
$ phpunit -c app src/Acme/DemoBundle/Tests/Utility/CalculatorTest.php
103103
104104
# run all tests for the entire Bundle

book/validation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ list of the available constraints - as well as the full class name for each
805805
constraint - is available in the :doc:`constraints reference</reference/constraints>`
806806
section .
807807

808-
The ``validateValule`` method returns a :class:`Symfony\\Component\\Validator\\ConstraintViolationList`
808+
The ``validateValue`` method returns a :class:`Symfony\\Component\\Validator\\ConstraintViolationList`
809809
object, which acts just like an array of errors. Each error in the collection
810810
is a :class:`Symfony\\Component\\Validator\\ConstraintViolation` object,
811811
which holds the error message on its `getMessage` method.

contributing/code/patches.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ Thank you for including the filled out template in your submission!
6060
bug fixes should be sent to the oldest still active branch. Furthermore
6161
submissions should, as a rule of thumb, not break backwards compatibility.
6262

63+
.. tip::
64+
65+
To automatically get your feature branch tested, you can add your fork to
66+
`travis-ci.org`_. Just login using your github.com account and then simply
67+
flip a single switch to enable automated testing. In your pull request,
68+
instead of specifying "*Symfony2 tests pass: [yes|no]*", you can link to
69+
the `travis-ci.org status icon`_. For more details, see the
70+
`travis-ci.org Getting Started Guide`_.
6371

6472
Initial Setup
6573
-------------
@@ -221,3 +229,6 @@ the `2.0` branch, the patch will also be applied by the core team on the
221229
.. _GitHub: https://github.com/signup/free
222230
.. _Symfony2 repository: https://github.com/symfony/symfony
223231
.. _dev mailing-list: http://groups.google.com/group/symfony-devs
232+
.. _travis-ci.org: http://travis-ci.org
233+
.. _`travis-ci.org status icon`: http://about.travis-ci.org/docs/user/status-images/
234+
.. _`travis-ci.org Getting Started Guide`: http://about.travis-ci.org/docs/user/getting-started/

cookbook/bundles/extension.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ and its name should be constructed by replacing the ``Bundle`` postfix of the
102102
Bundle class name with ``Extension``. For example, the Extension class of
103103
``AcmeHelloBundle`` would be called ``AcmeHelloExtension``::
104104

105-
// Acme/HelloBundle/DependencyInjection/HelloExtension.php
105+
// Acme/HelloBundle/DependencyInjection/AcmeHelloExtension.php
106106
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
107107
use Symfony\Component\DependencyInjection\ContainerBuilder;
108108

@@ -178,7 +178,7 @@ Parsing the ``$configs`` Array
178178
------------------------------
179179

180180
Whenever a user includes the ``acme_hello`` namespace in a configuration file,
181-
the configuration under it it is added to an array of configurations and
181+
the configuration under it is added to an array of configurations and
182182
passed to the ``load()`` method of your extension (Symfony2 automatically
183183
converts XML and YAML to an array).
184184

@@ -315,7 +315,7 @@ Configuring Services and Setting Parameters
315315

316316
Once you've loaded some service configuration, you may need to modify the
317317
configuration based on some of the input values. For example, suppose you
318-
have a service who's first argument is some string "type" that it will use
318+
have a service whose first argument is some string "type" that it will use
319319
internally. You'd like this to be easily configured by the bundle user, so
320320
in your service configuration file (e.g. ``services.xml``), you define this
321321
service and use a blank parameter - ``acme_hello.my_service_type`` - as
@@ -475,8 +475,8 @@ that an unsupported option was passed::
475475
}
476476

477477
The ``processConfiguration()`` method uses the configuration tree you've defined
478-
in the ``Configuration`` class and uses it to validate, normalize and merge
479-
all of the configuration arrays together.
478+
in the ``Configuration`` class to validate, normalize and merge all of the
479+
configuration arrays together.
480480

481481
The ``Configuration`` class can be much more complicated than shown here,
482482
supporting array nodes, "prototype" nodes, advanced validation, XML-specific

cookbook/configuration/pdo_session_storage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ following (MySQL):
165165
CREATE TABLE `session` (
166166
`session_id` varchar(255) NOT NULL,
167167
`session_value` text NOT NULL,
168-
`session_time` int(11) NOT NULL,
168+
`session_time` int(11) NOT NULL
169169
PRIMARY KEY (`session_id`),
170170
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
171171

cookbook/console.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. index::
2+
single: Console; CLI
3+
4+
15
How to create Console/Command-Line Commands
26
===========================================
37

@@ -173,6 +177,25 @@ will work:
173177
app/console demo:greet Fabien --iterations=5 --yell
174178
app/console demo:greet Fabien --yell --iterations=5
175179
180+
There are 4 option variants you can use:
181+
182+
=========================== =====================================================
183+
Option Value
184+
=========================== =====================================================
185+
InputOption::VALUE_IS_ARRAY This option accepts multiple values
186+
InputOption::VALUE_NONE Do not accept input for this option (e.g. ``--yell``)
187+
InputOption::VALUE_REQUIRED This value is required (e.g. ``iterations=5``)
188+
InputOption::VALUE_OPTIONAL This value is optional
189+
=========================== =====================================================
190+
191+
You can combine VALUE_IS_ARRAY with VALUE_REQUIRED or VALUE_OPTIONAL like this:
192+
193+
.. code-block:: php
194+
195+
$this
196+
// ...
197+
->addOption('iterations', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'How many times should the message be printed?', 1)
198+
1241 176199
Asking the User for Information
177200
-------------------------------
178201

cookbook/doctrine/file_uploads.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ object, which is what's returned after a ``file`` field is submitted::
213213
// move takes the target directory and then the target filename to move to
214214
$this->file->move($this->getUploadRootDir(), $this->file->getClientOriginalName());
215215

216-
// set the path property to the filename where you've saved the file
217-
$this->setPath($this->file->getClientOriginalName());
216+
// set the path property to the filename where you'ved saved the file
217+
$this->path = $this->file->getClientOriginalName();
218218

219219
// clean up the file property as you won't need it anymore
220220
$this->file = null;
@@ -263,7 +263,7 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
263263
{
264264
if (null !== $this->file) {
265265
// do whatever you want to generate a unique name
266-
$this->setPath(uniqid().'.'.$this->file->guessExtension());
266+
$this->path = uniqid().'.'.$this->file->guessExtension();
267267
}
268268
}
269269

@@ -338,7 +338,7 @@ property, instead of the actual filename::
338338
public function preUpload()
339339
{
340340
if (null !== $this->file) {
341-
$this->setPath($this->file->guessExtension());
341+
$this->path = $this->file->guessExtension();
342342
}
343343
}
344344

cookbook/form/data_transformers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Next, we create the data transformer, which does the actual conversion::
136136

137137
Finally, since we've decided to create a custom form type that uses the data
138138
transformer, register the Type in the service container, so that the entity
139-
manager can be automatically injected::
139+
manager can be automatically injected:
140140

141141
.. configuration-block::
142142

@@ -187,4 +187,4 @@ Controller at all.
187187
If you want a new issue to be created when an unknown number is entered, you
188188
can instantiate it rather than throwing the TransformationFailedException, and
189189
even persist it to your entity manager if the task has no cascading options
190-
for the issue.
190+
for the issue.

0 commit comments

Comments
 (0)
0