Skip to content

Commit e262aa6

Browse files
committed
Merge pull request #1597 from WouterJ/fixed_code_example_2
Fixed code example (2)
2 parents c1f5c4f + 056873e commit e262aa6

18 files changed

+113
-70
lines changed

book/controller.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ command:
553553

554554
.. code-block:: bash
555555
556-
php app/console container:debug
556+
$ php app/console container:debug
557557
558558
For more information, see the :doc:`/book/service_container` chapter.
559559

book/doctrine.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ persist it to the database and fetch it back out.
3737

3838
.. code-block:: bash
3939
40-
php app/console generate:bundle --namespace=Acme/StoreBundle
40+
$ php app/console generate:bundle --namespace=Acme/StoreBundle
4141
4242
Configuring the Database
4343
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -110,7 +110,7 @@ for you:
110110

111111
.. code-block:: bash
112112
113-
php app/console doctrine:database:create
113+
$ php app/console doctrine:database:create
114114
115115
Creating an Entity Class
116116
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -144,7 +144,7 @@ just a simple PHP class.
144144

145145
.. code-block:: bash
146146
147-
php app/console doctrine:generate:entity --entity="AcmeStoreBundle:Product" --fields="name:string(255) price:float description:text"
147+
$ php app/console doctrine:generate:entity --entity="AcmeStoreBundle:Product" --fields="name:string(255) price:float description:text"
148148
149149
.. index::
150150
single: Doctrine; Adding mapping metadata
@@ -305,7 +305,7 @@ a regular PHP class, you need to create getter and setter methods (e.g. ``getNam
305305

306306
.. code-block:: bash
307307
308-
php app/console doctrine:generate:entities Acme/StoreBundle/Entity/Product
308+
$ php app/console doctrine:generate:entities Acme/StoreBundle/Entity/Product
309309
310310
This command makes sure that all of the getters and setters are generated
311311
for the ``Product`` class. This is a safe command - you can run it over and
@@ -339,8 +339,8 @@ mapping information) of a bundle or an entire namespace:
339339

340340
.. code-block:: bash
341341
342-
php app/console doctrine:generate:entities AcmeStoreBundle
343-
php app/console doctrine:generate:entities Acme
342+
$ php app/console doctrine:generate:entities AcmeStoreBundle
343+
$ php app/console doctrine:generate:entities Acme
344344
345345
.. note::
346346

@@ -360,7 +360,7 @@ in your application. To do this, run:
360360

361361
.. code-block:: bash
362362
363-
php app/console doctrine:schema:update --force
363+
$ php app/console doctrine:schema:update --force
364364
365365
.. tip::
366366

@@ -753,7 +753,7 @@ used earlier to generate the missing getter and setter methods:
753753

754754
.. code-block:: bash
755755
756-
php app/console doctrine:generate:entities Acme
756+
$ php app/console doctrine:generate:entities Acme
757757
758758
Next, add a new method - ``findAllOrderedByName()`` - to the newly generated
759759
repository class. This method will query for all of the ``Product`` entities,
@@ -805,7 +805,7 @@ you can let Doctrine create the class for you.
805805

806806
.. code-block:: bash
807807
808-
php app/console doctrine:generate:entity --entity="AcmeStoreBundle:Category" --fields="name:string(255)"
808+
$ php app/console doctrine:generate:entity --entity="AcmeStoreBundle:Category" --fields="name:string(255)"
809809
810810
This task generates the ``Category`` entity for you, with an ``id`` field,
811811
a ``name`` field and the associated getter and setter functions.
@@ -916,7 +916,7 @@ methods for you:
916916

917917
.. code-block:: bash
918918
919-
php app/console doctrine:generate:entities Acme
919+
$ php app/console doctrine:generate:entities Acme
920920
921921
Ignore the Doctrine metadata for a moment. You now have two classes - ``Category``
922922
and ``Product`` with a natural one-to-many relationship. The ``Category``
@@ -945,7 +945,7 @@ table, and ``product.category_id`` column, and new foreign key:
945945

946946
.. code-block:: bash
947947
948-
php app/console doctrine:schema:update --force
948+
$ php app/console doctrine:schema:update --force
949949
950950
.. note::
951951

@@ -1348,7 +1348,7 @@ without any arguments:
13481348

13491349
.. code-block:: bash
13501350
1351-
php app/console
1351+
$ php app/console
13521352
13531353
A list of available command will print out, many of which start with the
13541354
``doctrine:`` prefix. You can find out more information about any of these
@@ -1357,7 +1357,7 @@ to get details about the ``doctrine:database:create`` task, run:
13571357

13581358
.. code-block:: bash
13591359
1360-
php app/console help doctrine:database:create
1360+
$ php app/console help doctrine:database:create
13611361
13621362
Some notable or interesting tasks include:
13631363

@@ -1367,7 +1367,7 @@ Some notable or interesting tasks include:
13671367

13681368
.. code-block:: bash
13691369
1370-
php app/console doctrine:ensure-production-settings --env=prod
1370+
$ php app/console doctrine:ensure-production-settings --env=prod
13711371
13721372
* ``doctrine:mapping:import`` - allows Doctrine to introspect an existing
13731373
database and create mapping information. For more information, see

book/forms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ going to need to build a form. But before you begin, first focus on the generic
6464

6565
.. code-block:: bash
6666
67-
php app/console generate:bundle --namespace=Acme/TaskBundle
67+
$ php app/console generate:bundle --namespace=Acme/TaskBundle
6868
6969
This class is a "plain-old-PHP-object" because, so far, it has nothing
7070
to do with Symfony or any other library. It's quite simply a normal PHP object

book/installation.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ one of the following commands (replacing ``###`` with your actual filename):
4949
.. code-block:: bash
5050
5151
# for .tgz file
52-
tar zxvf Symfony_Standard_Vendors_2.0.###.tgz
52+
$ tar zxvf Symfony_Standard_Vendors_2.0.###.tgz
5353
5454
# for a .zip file
55-
unzip Symfony_Standard_Vendors_2.0.###.zip
55+
$ unzip Symfony_Standard_Vendors_2.0.###.zip
5656
5757
When you're finished, you should have a ``Symfony/`` directory that looks
5858
something like this:
@@ -81,7 +81,7 @@ by running the following command from the command line:
8181

8282
.. code-block:: bash
8383
84-
php bin/vendors install
84+
$ php bin/vendors install
8585
8686
This command downloads all of the necessary vendor libraries - including
8787
Symfony itself - into the ``vendor/`` directory. For more information on
@@ -121,11 +121,11 @@ If there are any issues, correct them now before moving on.
121121

122122
.. code-block:: bash
123123
124-
rm -rf app/cache/*
125-
rm -rf app/logs/*
124+
$ rm -rf app/cache/*
125+
$ rm -rf app/logs/*
126126
127-
sudo chmod +a "www-data allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
128-
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
127+
$ sudo chmod +a "www-data allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
128+
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
129129
130130
**2. Using Acl on a system that does not support chmod +a**
131131

@@ -136,8 +136,8 @@ If there are any issues, correct them now before moving on.
136136

137137
.. code-block:: bash
138138
139-
sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
140-
sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
139+
$ sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
140+
$ sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
141141
142142
Note that not all web servers run as the user ``www-data``. You have to
143143
check which user the web server is being run as and put it in for ``www-data``.

book/page_creation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ instructions (use all of the default options):
6969

7070
.. code-block:: bash
7171
72-
php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml
72+
$ php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml
7373
7474
Behind the scenes, a directory is created for the bundle at ``src/Acme/HelloBundle``.
7575
A line is also automatically added to the ``app/AppKernel.php`` file so that
@@ -261,7 +261,7 @@ application should greet you:
261261

262262
.. code-block:: bash
263263
264-
php app/console cache:clear --env=prod --no-debug
264+
$ php app/console cache:clear --env=prod --no-debug
265265
266266
An optional, but common, third step in the process is to create a template.
267267

@@ -667,7 +667,7 @@ generating a basic bundle skeleton:
667667

668668
.. code-block:: bash
669669
670-
php app/console generate:bundle --namespace=Acme/TestBundle
670+
$ php app/console generate:bundle --namespace=Acme/TestBundle
671671
672672
The bundle skeleton generates with a basic controller, template and routing
673673
resource that can be customized. You'll learn more about Symfony2's command-line

book/propel.rst

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ persist it to the database and fetch it back out.
2222

2323
.. code-block:: bash
2424
25-
php app/console generate:bundle --namespace=Acme/StoreBundle
25+
$ php app/console generate:bundle --namespace=Acme/StoreBundle
2626
2727
Configuring the Database
2828
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -33,7 +33,7 @@ information. By convention, this information is usually configured in an
3333

3434
.. code-block:: ini
3535
36-
;app/config/parameters.ini
36+
; app/config/parameters.ini
3737
[parameters]
3838
database_driver = mysql
3939
database_host = localhost
@@ -62,7 +62,7 @@ you:
6262

6363
.. code-block:: bash
6464
65-
php app/console propel:database:create
65+
$ php app/console propel:database:create
6666
6767
.. note::
6868

@@ -104,7 +104,7 @@ After creating your ``schema.xml``, generate your model from it by running:
104104

105105
.. code-block:: bash
106106
107-
php app/console propel:model:build
107+
$ php app/console propel:model:build
108108
109109
This generates each model class to quickly develop your application in the
110110
``Model/`` directory the ``AcmeStoreBundle`` bundle.
@@ -119,9 +119,8 @@ needed for every known model in your application. To do this, run:
119119

120120
.. code-block:: bash
121121
122-
php app/console propel:sql:build
123-
124-
php app/console propel:sql:insert --force
122+
$ php app/console propel:sql:build
123+
$ php app/console propel:sql:insert --force
125124
126125
Your database now has a fully-functional ``product`` table with columns that
127126
match the schema you've specified.
@@ -305,17 +304,16 @@ Create the classes:
305304

306305
.. code-block:: bash
307306
308-
php app/console propel:model:build
307+
$ php app/console propel:model:build
309308
310309
Assuming you have products in your database, you don't want lose them. Thanks to
311310
migrations, Propel will be able to update your database without losing existing
312311
data.
313312

314313
.. code-block:: bash
315314
316-
php app/console propel:migration:generate-diff
317-
318-
php app/console propel:migration:migrate
315+
$ php app/console propel:migration:generate-diff
316+
$ php app/console propel:migration:migrate
319317
320318
Your database has been updated, you can continue to write your application.
321319

book/routing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ the command by running the following from the root of your project.
10261026

10271027
.. code-block:: bash
10281028
1029-
php app/console router:debug
1029+
$ php app/console router:debug
10301030
10311031
The command will print a helpful list of *all* the configured routes in
10321032
your application:
@@ -1045,7 +1045,7 @@ the route name after the command:
10451045

10461046
.. code-block:: bash
10471047
1048-
php app/console router:debug article_show
1048+
$ php app/console router:debug article_show
10491049
10501050
.. index::
10511051
single: Routing; Generating URLs

book/translation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ filesystem and discovered by Symfony, thanks to some conventions.
270270

271271
.. code-block:: bash
272272
273-
php app/console cache:clear
273+
$ php app/console cache:clear
274274
275275
.. index::
276276
single: Translations; Translation resource locations

components/console.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Test the new console command by running the following
8282

8383
.. code-block:: bash
8484
85-
app/console demo:greet Fabien
85+
$ app/console demo:greet Fabien
8686
8787
This will print the following to the command line:
8888

@@ -94,7 +94,7 @@ You can also use the ``--yell`` option to make everything uppercase:
9494

9595
.. code-block:: bash
9696
97-
app/console demo:greet Fabien --yell
97+
$ app/console demo:greet Fabien --yell
9898
9999
This prints::
100100

@@ -154,8 +154,8 @@ The command can now be used in either of the following ways:
154154

155155
.. code-block:: bash
156156
157-
app/console demo:greet Fabien
158-
app/console demo:greet Fabien Potencier
157+
$ app/console demo:greet Fabien
158+
$ app/console demo:greet Fabien Potencier
159159
160160
Using Command Options
161161
---------------------
@@ -193,9 +193,8 @@ flag:
193193

194194
.. code-block:: bash
195195
196-
app/console demo:greet Fabien
197-
198-
app/console demo:greet Fabien --iterations=5
196+
$ app/console demo:greet Fabien
197+
$ app/console demo:greet Fabien --iterations=5
199198
200199
The first example will only print once, since ``iterations`` is empty and
201200
defaults to ``1`` (the last argument of ``addOption``). The second example
@@ -206,8 +205,8 @@ will work:
206205

207206
.. code-block:: bash
208207
209-
app/console demo:greet Fabien --iterations=5 --yell
210-
app/console demo:greet Fabien --yell --iterations=5
208+
$ app/console demo:greet Fabien --iterations=5 --yell
209+
$ app/console demo:greet Fabien --yell --iterations=5
211210
212211
There are 4 option variants you can use:
213212

0 commit comments

Comments
 (0)