Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Simplified some Symfony installation instructions #4811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 6 additions & 26 deletions best_practices/creating-the-project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,15 @@ In the past, Symfony projects were created with `Composer`_, the dependency mana
for PHP applications. However, the current recommendation is to use the **Symfony
Installer**, which has to be installed before creating your first project.

Linux and Mac OS X Systems
~~~~~~~~~~~~~~~~~~~~~~~~~~

Open your command console and execute the following:

.. code-block:: bash

$ curl -LsS http://symfony.com/installer > symfony.phar
$ sudo mv symfony.phar /usr/local/bin/symfony
$ chmod a+x /usr/local/bin/symfony

Now you can execute the Symfony Installer as a global system command called
``symfony``.

Windows Systems
~~~~~~~~~~~~~~~

Open your command console and execute the following:

.. code-block:: bash

c:\> php -r "readfile('http://symfony.com/installer');" > symfony.phar
.. best-practice::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add labels for the old and now removed headlines.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javiereguiluz After adding these labels, this should be ready.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for missing your comment. I've tried to add the labels in c8b16cf. Please tell me if it's OK. Thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about moving it before the "Creating the Blog Application" headline?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better. Done. Thanks.


Then, move the downloaded ``symfony.phar`` file to your projects directory and
execute it as follows:
Use the Symfony Installer to create new Symfony-based projects.

.. code-block:: bash
Read the :doc:`installation chapter </book/installation>` of the Symfony Book to
learn how to install and use the Symfony Installer.

c:\> php symfony.phar
.. _linux-and-mac-os-x-systems:
.. _windows-systems:

Creating the Blog Application
-----------------------------
Expand Down
51 changes: 27 additions & 24 deletions book/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ Installing and Configuring Symfony

The goal of this chapter is to get you up and running with a working application
built on top of Symfony. In order to simplify the process of creating new
applications, Symfony provides an installer that must be installed before
creating the first application.
applications, Symfony provides an installer application.

Installing the Symfony Installer
--------------------------------

Using the Symfony Installer is the only recommended way to create new Symfony
applications. This installer is a PHP application that has to be installed
only once and then it can create any number of Symfony applications.
Using the **Symfony Installer** is the only recommended way to create new Symfony
applications. This installer is a PHP application that has to be installed in your
system only once and then it can create any number of Symfony applications.

.. note::

Expand All @@ -29,16 +28,14 @@ ways.
Linux and Mac OS X Systems
~~~~~~~~~~~~~~~~~~~~~~~~~~

Open your command console and execute the following three commands:
Open your command console and execute the following commands:

.. code-block:: bash

$ curl -LsS http://symfony.com/installer > symfony.phar
$ sudo mv symfony.phar /usr/local/bin/symfony
$ chmod a+x /usr/local/bin/symfony
$ sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony
$ sudo chmod a+x /usr/local/bin/symfony

This will create a global ``symfony`` command in your system that will be used
to create new Symfony applications.
This will create a global ``symfony`` command in your system.

Windows Systems
~~~~~~~~~~~~~~~
Expand All @@ -47,21 +44,21 @@ Open your command console and execute the following command:

.. code-block:: bash

c:\> php -r "readfile('http://symfony.com/installer');" > symfony.phar
c:\> php -r "readfile('http://symfony.com/installer');" > symfony

Then, move the downloaded ``symfony.phar`` file to your projects directory and
Then, move the downloaded ``symfony`` file to your projects directory and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no way to install the command globally on Windows?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here there are some instructions proposed by a Symfony Installer user (https://github.com/symfony/symfony-installer/issues/117) but I haven't tested them. Ideally we'd provide an executable installer as Composer does.

execute it as follows:

.. code-block:: bash

c:\> move symfony.phar c:\projects
c:\projects\> php symfony.phar
c:\> move symfony c:\projects
c:\projects\> php symfony

Creating the Symfony Application
--------------------------------

Once the Symfony Installer is ready, create your first Symfony application with
the ``new`` command:
Once the Symfony Installer is available, create your first Symfony application
with the ``new`` command:

.. code-block:: bash

Expand All @@ -70,7 +67,7 @@ the ``new`` command:

# Windows
c:\> cd projects/
c:\projects\> php symfony.phar new my_project_name
c:\projects\> php symfony new my_project_name

This command creates a new directory called ``my_project_name`` that contains a
fresh new project based on the most recent stable Symfony version available. In
Expand All @@ -87,16 +84,22 @@ to meet those requirements.
Basing your Project on a Specific Symfony Version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If your project needs to be based on a specific Symfony version, pass the version
number as the second argument of the ``new`` command:
In case your project needs to be based on a specific Symfony version, use the
optional second argument of the ``new`` command:

.. code-block:: bash

# Linux, Mac OS X
$ symfony new my_project_name 2.3.23
# use the most recent version in any Symfony branch
$ symfony new my_project_name 2.3
$ symfony new my_project_name 2.5
$ symfony new my_project_name 2.6

# Windows
c:\projects\> php symfony.phar new my_project_name 2.3.23
# use a specific Symfony version
$ symfony new my_project_name 2.3.26
$ symfony new my_project_name 2.6.5

# use the most recent LTS (Long Term Support) version
$ symfony new my_project_name lts

Read the :doc:`Symfony Release process </contributing/community/releases>`
to better understand why there are several Symfony versions and which one
Expand Down
11 changes: 0 additions & 11 deletions quick_tour/the_big_picture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@ On **Linux** and **Mac OS X** systems, execute the following console commands:
$ sudo mv symfony.phar /usr/local/bin/symfony
$ chmod a+x /usr/local/bin/symfony
.. note::

If your system doesn't have cURL installed, execute the following
commands instead:

.. code-block:: bash
$ php -r "readfile('http://symfony.com/installer');" > symfony.phar
$ sudo mv symfony.phar /usr/local/bin/symfony
$ chmod a+x /usr/local/bin/symfony
After installing the Symfony installer, you'll have to open a new console window
to be able to execute the new ``symfony`` command:

Expand Down