Skip to content

Commit

Permalink
simplifies Twig installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Oct 14, 2014
1 parent 875a56c commit 98f1a4b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 37 deletions.
55 changes: 19 additions & 36 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,11 @@ Installing the Twig PHP package
Installing via Composer (recommended)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. Install Composer in your project:
Install `Composer`_ and run the following command to get the latest version:

.. code-block:: bash
curl -s http://getcomposer.org/installer | php
2. Create a ``composer.json`` file in your project root:

.. code-block:: javascript
{
"require": {
"twig/twig": "1.*"
}
}
3. Install via Composer

.. code-block:: bash
php composer.phar install
.. note::
If you want to learn more about Composer, the ``composer.json`` file syntax
and its usage, you can read the `online documentation`_.
composer require twig/twig:~1.0
Installing from the tarball release
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -46,8 +26,9 @@ Installing from the tarball release
Installing the development version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. Install Git
2. ``git clone git://github.com/fabpot/Twig.git``
.. code-block:: bash
git clone git://github.com/fabpot/Twig.git
Installing the PEAR package
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -57,9 +38,10 @@ Installing the PEAR package
Using PEAR for installing Twig is deprecated and Twig 1.15.1 was the last
version published on the PEAR channel; use Composer instead.

1. Install PEAR
2. ``pear channel-discover pear.twig-project.org``
3. ``pear install twig/Twig``
.. code-block:: bash
pear channel-discover pear.twig-project.org
pear install twig/Twig
Installing the C extension
--------------------------
Expand All @@ -76,21 +58,22 @@ runtime engine; install it like any other PHP extensions:

.. code-block:: bash
$ cd ext/twig
$ phpize
$ ./configure
$ make
$ make install
cd ext/twig
phpize
./configure
make
make install
.. note::

You can also install the C extension via PEAR (note that this method is
deprecated and newer versions of Twig are not available on the PEAR
channel):

1. Install PEAR
2. ``pear channel-discover pear.twig-project.org``
3. ``pear install twig/CTwig``
.. code-block:: bash
pear channel-discover pear.twig-project.org
pear install twig/CTwig
For Windows:

Expand Down Expand Up @@ -125,6 +108,6 @@ PHP code but only provides an optimized version of the
``Twig_Template::getAttribute()`` method.

.. _`download page`: https://github.com/fabpot/Twig/tags
.. _`online documentation`: http://getcomposer.org/doc
.. _`Composer`: https://getcomposer.org/download/
.. _`PHP documentation`: https://wiki.php.net/internals/windows/stepbystepbuild
.. _`Zend Server FAQ`: http://www.zend.com/en/products/server/faq#faqD6
2 changes: 1 addition & 1 deletion doc/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The recommended way to install Twig is via Composer:

.. code-block:: bash
composer require "twig/twig:1.*"
composer require "twig/twig:~1.0"
.. note::

Expand Down

0 comments on commit 98f1a4b

Please sign in to comment.