Skip to content

Commit 4c40000

Browse files
committed
minor symfony#12078 Updated some console commands (javiereguiluz)
This PR was squashed before being merged into the 3.4 branch (closes symfony#12078). Discussion ---------- Updated some console commands This makes two changes: * I was told on Symfony Slack that using `c:\>` is wrong for Windows. Better use `>` (even if you have run a `cd ...` command before) * On symfony.com the console decoration changes depending on your operating system. But in the docs, some commands are only for Windows or only for Linux/macOS. In those special cases, we cannot change the console decoration, so let's apply a CSS class to tell that they are Windows-only or Linux-only commands. Commits ------- bd50c9a Updated some console commands
2 parents e2b02d7 + bd50c9a commit 4c40000

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

_build/_themes/_exts/symfonycom/sphinx/lexer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class TerminalLexer(RegexLexer):
1010
tokens = {
1111
'root': [
1212
('^\$', Generic.Prompt, 'bash-prompt'),
13-
('^C:\\[^\n>]+>', Generic.Prompt, 'dos-prompt'),
13+
('^>', Generic.Prompt, 'dos-prompt'),
1414
('^#.+$', Comment.Single),
1515
('^.+$', Generic.Output),
1616
],

best_practices/creating-the-project.rst

+10-3
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,21 @@ Now that everything is correctly set up, you can create a new project based on
2525
Symfony. In your command console, browse to a directory where you have permission
2626
to create files and execute the following commands:
2727

28+
**Linux and macOS systems**:
29+
30+
.. class:: command-linux
2831
.. code-block:: terminal
2932
3033
$ cd projects/
3134
$ symfony new blog 3.4
3235
33-
# Windows
34-
c:\> cd projects/
35-
c:\projects\> php symfony new blog 3.4
36+
**Windows systems**:
37+
38+
.. class:: command-windows
39+
.. code-block:: terminal
40+
41+
> cd projects/
42+
> php symfony new blog 3.4
3643
3744
.. note::
3845

setup.rst

+17-10
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,21 @@ Symfony provides a dedicated application called the **Symfony Installer** to eas
2020
the creation of Symfony applications. This installer is a PHP 5.4 compatible
2121
executable that needs to be installed on your system only once:
2222

23+
**Linux and macOS systems**:
24+
25+
.. class:: command-linux
2326
.. code-block:: terminal
2427
25-
# Linux and macOS systems
2628
$ sudo mkdir -p /usr/local/bin
2729
$ sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony
2830
$ sudo chmod a+x /usr/local/bin/symfony
2931
30-
# Windows systems
31-
c:\> php -r "file_put_contents('symfony', file_get_contents('https://symfony.com/installer'));"
32+
**Windows systems**:
33+
34+
.. class:: command-windows
35+
.. code-block:: terminal
36+
37+
> php -r "file_put_contents('symfony', file_get_contents('https://symfony.com/installer'));"
3238
3339
.. note::
3440

@@ -37,21 +43,22 @@ executable that needs to be installed on your system only once:
3743
environment variable and create a ``symfony.bat`` file to create the global
3844
command or move it to any other directory convenient for you:
3945

46+
.. class:: command-windows
4047
.. code-block:: terminal
4148
4249
# for example, if WAMP is used ...
43-
c:\> move symfony c:\wamp\bin\php
50+
> move symfony c:\wamp\bin\php
4451
# create symfony.bat in the same folder
45-
c:\> cd c:\wamp\bin\php
46-
c:\> (echo @ECHO OFF & echo php "%~dp0symfony" %*) > symfony.bat
52+
> cd c:\wamp\bin\php
53+
> (echo @ECHO OFF & echo php "%~dp0symfony" %*) > symfony.bat
4754
# ... then, execute the command as:
48-
c:\> symfony
55+
> symfony
4956
5057
# moving it to your projects folder ...
51-
c:\> move symfony c:\projects
58+
> move symfony c:\projects
5259
# ... then, execute the command as
53-
c:\> cd projects
54-
c:\projects\> php symfony
60+
> cd projects
61+
> php symfony
5562
5663
.. _installation-creating-the-app:
5764

0 commit comments

Comments
 (0)