Commit 281a3c1e authored by Fabien Potencier's avatar Fabien Potencier

added more information about how to install Silex

parent 1dcc05dd
...@@ -22,7 +22,9 @@ step. ...@@ -22,7 +22,9 @@ step.
**Let's go!**:: **Let's go!**::
require_once __DIR__.'/vendor/autoload.php'; // web/index.php
require_once __DIR__.'/../vendor/autoload.php';
$app = new Silex\Application(); $app = new Silex\Application();
...@@ -43,6 +45,6 @@ Finally, the app is run. Visit ``/hello/world`` to see the result. ...@@ -43,6 +45,6 @@ Finally, the app is run. Visit ``/hello/world`` to see the result.
It's really that easy! It's really that easy!
Installing Silex is as easy as it can get. Download the `silex.zip`_ file, Installing Silex is as easy as it can get. Download the `silex.zip`_ file,
unzip it, and you're done! extract it, and you're done!
.. _silex.zip: http://silex.sensiolabs.org/get/silex.zip .. _silex.zip: http://silex.sensiolabs.org/get/silex.zip
...@@ -3,6 +3,40 @@ Usage ...@@ -3,6 +3,40 @@ Usage
This chapter describes how to use Silex. This chapter describes how to use Silex.
Installation
------------
If you want to get started fast, download either the `silex.zip`_ or the
`silex.tgz`_ archive and extract it, you should have the following directory
structure:
.. code-block:: text
├── composer.json
├── composer.lock
├── vendor
│ └── ...
└── web
└── index.php
If you want more flexibility, use Composer instead. Create a
``composer.json``:
.. code-block:: json
{
"require": {
"silex/silex": "dev-master"
}
}
And run Composer to install Silex and all its dependencies:
.. code-block:: bash
$ curl -s http://getcomposer.org/installer | php
$ composer.phar install
Bootstrap Bootstrap
--------- ---------
...@@ -10,7 +44,9 @@ To bootstrap Silex, all you need to do is require the ``vendor/autoload.php`` ...@@ -10,7 +44,9 @@ To bootstrap Silex, all you need to do is require the ``vendor/autoload.php``
file and create an instance of ``Silex\Application``. After your controller file and create an instance of ``Silex\Application``. After your controller
definitions, call the ``run`` method on your application:: definitions, call the ``run`` method on your application::
require_once __DIR__.'/vendor/autoload.php'; // web/index.php
require_once __DIR__.'/../vendor/autoload.php';
$app = new Silex\Application(); $app = new Silex\Application();
...@@ -779,3 +815,5 @@ this sample ``web.config`` file: ...@@ -779,3 +815,5 @@ this sample ``web.config`` file:
</configuration> </configuration>
.. _FallbackResource directive: http://www.adayinthelifeof.nl/2012/01/21/apaches-fallbackresource-your-new-htaccess-command/ .. _FallbackResource directive: http://www.adayinthelifeof.nl/2012/01/21/apaches-fallbackresource-your-new-htaccess-command/
.. _silex.zip: http://silex.sensiolabs.org/get/silex.zip
.. _silex.tgz: http://silex.sensiolabs.org/get/silex.tgz
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment