Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
29076993
Commit
29076993
authored
Oct 14, 2014
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplified Composer instructions
parent
2603afb3
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
55 additions
and
140 deletions
+55
-140
README.rst
README.rst
+3
-9
doc/cookbook/validator_yaml.rst
doc/cookbook/validator_yaml.rst
+3
-6
doc/providers/doctrine.rst
doc/providers/doctrine.rst
+3
-6
doc/providers/form.rst
doc/providers/form.rst
+12
-26
doc/providers/monolog.rst
doc/providers/monolog.rst
+3
-6
doc/providers/security.rst
doc/providers/security.rst
+3
-6
doc/providers/serializer.rst
doc/providers/serializer.rst
+3
-6
doc/providers/swiftmailer.rst
doc/providers/swiftmailer.rst
+3
-6
doc/providers/translation.rst
doc/providers/translation.rst
+6
-12
doc/providers/twig.rst
doc/providers/twig.rst
+6
-12
doc/providers/url_generator.rst
doc/providers/url_generator.rst
+2
-2
doc/providers/validator.rst
doc/providers/validator.rst
+3
-6
doc/testing.rst
doc/testing.rst
+3
-7
doc/usage.rst
doc/usage.rst
+2
-30
No files found.
README.rst
View file @
29076993
...
...
@@ -23,17 +23,11 @@ Silex works with PHP 5.3.3 or later.
Installation
------------
The recommended way to install Silex is through `Composer`_. Just create a
``composer.json`` file and run the ``php composer.phar install`` command to
install it:
The recommended way to install Silex is through `Composer`_:
.. code-block::
json
.. code-block::
bash
{
"require": {
"silex/silex": "~1.1"
}
}
composer require "silex/silex:~1.2"
Alternatively, you can download the `silex.zip`_ file and extract it.
...
...
doc/cookbook/validator_yaml.rst
View file @
29076993
...
...
@@ -5,14 +5,11 @@ Simplicity is at the heart of Silex so there is no out of the box solution to
use YAML files for validation. But this doesn't mean that this is not
possible. Let's see how to do it.
First, you need to install the YAML Component. Declare it as a dependency in
your ``composer.json`` file:
First, you need to install the YAML Component:
.. code-block::
json
.. code-block::
bash
"require": {
"symfony/yaml": "~2.3"
}
composer require symfony/yaml
Next, you need to tell the Validation Service that you are not using
``StaticMethodLoader`` to load your class metadata but a YAML file::
...
...
doc/providers/doctrine.rst
View file @
29076993
...
...
@@ -67,14 +67,11 @@ Registering
.. note::
Doctrine DBAL comes with the "fat" Silex archive but not with the regular
one. If you are using Composer, add it as a dependency to your
``composer.json`` file:
one. If you are using Composer, add it as a dependency:
.. code-block::
json
.. code-block::
bash
"require": {
"doctrine/dbal": "2.2.*",
}
composer require "doctrine/dbal:~2.2"
Usage
-----
...
...
doc/providers/form.rst
View file @
29076993
...
...
@@ -46,54 +46,40 @@ Registering
.. note::
The Symfony Form Component and all its dependencies (optional or not) comes
with the "fat" Silex archive but not with the regular one.
with the "fat" Silex archive but not with the regular one. If you are using
Composer, add it as a dependency:
If you are using Composer, add it as a dependency to your
``composer.json`` file:
.. code-block:: bash
.. code-block:: json
"require": {
"symfony/form": "~2.3"
}
composer require symfony/form
If you are going to use the validation extension with forms, you must also
add a dependency to the ``symfony/config`` and ``symfony/translation``
components:
.. code-block::
json
.. code-block::
bash
"require": {
"symfony/validator": "~2.3",
"symfony/config": "~2.3",
"symfony/translation": "~2.3"
}
composer require symfony/validator symfony/config symfony/translation
The Symfony Form Component relies on the PHP intl extension. If you don't have
it, you can install the Symfony Locale Component as a replacement:
.. code-block::
json
.. code-block::
bash
"require": {
"symfony/locale": "~2.3"
}
composer require symfony/locale
The Symfony Security CSRF component is used to protect forms against CSRF attacks:
.. code-block::
json
.. code-block::
bash
"require": {
"symfony/security-csrf": "~2.4"
}
composer require symfony/security-csrf
If you want to use forms in your Twig templates, make sure to install the
Symfony Twig Bridge:
.. code-block::
json
.. code-block::
bash
"require": {
"symfony/twig-bridge": "~2.3"
}
composer require symfony/twig-bridge
Usage
-----
...
...
doc/providers/monolog.rst
View file @
29076993
...
...
@@ -51,14 +51,11 @@ Registering
.. note::
Monolog comes with the "fat" Silex archive but not with the regular one.
If you are using Composer, add it as a dependency to your
``composer.json`` file:
If you are using Composer, add it as a dependency:
.. code-block::
json
.. code-block::
bash
"require": {
"monolog/monolog": ">=1.0.0"
}
composer require monolog/monolog
Usage
-----
...
...
doc/providers/security.rst
View file @
29076993
...
...
@@ -55,14 +55,11 @@ Registering
.. note::
The Symfony Security Component comes with the "fat" Silex archive but not
with the regular one. If you are using Composer, add it as a dependency to
your ``composer.json`` file:
with the regular one. If you are using Composer, add it as a dependency:
.. code-block::
json
.. code-block::
bash
"require": {
"symfony/security": "~2.3"
}
composer require symfony/security
.. caution::
...
...
doc/providers/serializer.rst
View file @
29076993
...
...
@@ -36,14 +36,11 @@ Registering
The *SerializerServiceProvider* relies on Symfony's `Serializer Component
<http://symfony.com/doc/current/components/serializer.html>`_,
which comes with the "fat" Silex archive but not with the regular
one. If you are using Composer, add it as a dependency to your
``composer.json`` file:
one. If you are using Composer, add it as a dependency:
.. code-block::
json
.. code-block::
bash
"require": {
"symfony/serializer": ">=2.3,<2.5-dev",
}
composer require symfony/serializer
Usage
-----
...
...
doc/providers/swiftmailer.rst
View file @
29076993
...
...
@@ -69,14 +69,11 @@ Registering
.. note::
SwiftMailer comes with the "fat" Silex archive but not with the regular
one. If you are using Composer, add it as a dependency to your
``composer.json`` file:
one. If you are using Composer, add it as a dependency:
.. code-block::
json
.. code-block::
bash
"require": {
"swiftmailer/swiftmailer": ">=4.1.2,<4.2-dev"
}
composer require swiftmailer/swiftmailer
Usage
-----
...
...
doc/providers/translation.rst
View file @
29076993
...
...
@@ -45,13 +45,11 @@ Registering
The Symfony Translation Component comes with the "fat" Silex archive but
not with the regular one. If you are using Composer, add it as a
dependency
to your ``composer.json`` file
:
dependency:
.. code-block::
json
.. code-block::
bash
"require": {
"symfony/translation": "~2.3"
}
composer require symfony/translation
Usage
-----
...
...
@@ -120,15 +118,11 @@ YAML-based language files
Having your translations in PHP files can be inconvenient. This recipe will
show you how to load translations from external YAML files.
First, add the Symfony2 ``Config`` and ``Yaml`` components in your composer
file:
First, add the Symfony2 ``Config`` and ``Yaml`` components as dependencies:
.. code-block::
json
.. code-block::
bash
"require": {
"symfony/config": "~2.3",
"symfony/yaml": "~2.3"
}
composer require symfony/config symfony/yaml
Next, you have to create the language mappings in YAML files. A naming you can
use is ``locales/en.yml``. Just do the mapping in this file as follows:
...
...
doc/providers/twig.rst
View file @
29076993
...
...
@@ -42,27 +42,21 @@ Registering
.. note::
Twig comes with the "fat" Silex archive but not with the regular one. If
you are using Composer, add it as a dependency to your ``composer.json``
file:
you are using Composer, add it as a dependency:
.. code-block::
json
.. code-block::
bash
"require": {
"twig/twig": ">=1.8,<2.0-dev"
}
composer require twig/twig
Symfony2 Components Integration
-------------------------------
Symfony provides a Twig bridge that provides additional integration between
some Symfony2 components and Twig. Add it as a dependency to your
``composer.json`` file:
some Symfony2 components and Twig. Add it as a dependency:
.. code-block::
json
.. code-block::
bash
"require": {
"symfony/twig-bridge": "~2.3"
}
composer require symfony/twig-bridge
When present, the ``TwigServiceProvider`` will provide you with the following
additional capabilities:
...
...
doc/providers/url_generator.rst
View file @
29076993
...
...
@@ -54,8 +54,8 @@ When using Twig, the service can be used like this:
{{ app.url_generator.generate('homepage') }}
Moreover, if you have ``twig-bridge``
in your ``composer.json``, you will have access to the ``path()`` and
``url()`` functions:
Moreover, if you have ``twig-bridge``
as a Composer dep, you will have access
to the ``path()`` and
``url()`` functions:
.. code-block:: jinja
...
...
doc/providers/validator.rst
View file @
29076993
...
...
@@ -38,14 +38,11 @@ Registering
.. note::
The Symfony Validator Component comes with the "fat" Silex archive but not
with the regular one. If you are using Composer, add it as a dependency to
your ``composer.json`` file:
with the regular one. If you are using Composer, add it as a dependency:
.. code-block::
json
.. code-block::
bash
"require": {
"symfony/validator": "~2.3"
}
composer require symfony/validator
Usage
-----
...
...
doc/testing.rst
View file @
29076993
...
...
@@ -79,15 +79,11 @@ use it by making your test extend it::
.. note::
If you want to use the Symfony2 ``WebTestCase`` class you will need to
explicitly install its dependencies for your project. Add the following to
your ``composer.json`` file:
explicitly install its dependencies for your project:
.. code-block::
json
.. code-block::
bash
"require-dev": {
"symfony/browser-kit": ">=2.3,<2.4-dev",
"symfony/css-selector": ">=2.3,<2.4-dev"
}
composer require --dev symfony/browser-kit symfony/css-selector
For your WebTestCase, you will have to implement a ``createApplication``
method, which returns your application. It will probably look like this::
...
...
doc/usage.rst
View file @
29076993
...
...
@@ -18,39 +18,11 @@ it, you should have the following directory structure:
└── web
└── index.php
If you want more flexibility, use Composer_ instead. Create a
``composer.json`` file and put this in it:
.. code-block:: json
{
"require": {
"silex/silex": "~1.1"
}
}
And run Composer to install Silex and all its dependencies:
.. code-block:: bash
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar install
.. tip::
By default, Silex relies on the stable Symfony components. If you want to
use their master version instead, add ``"minimum-stability": "dev"`` in
your ``composer.json`` file.
Upgrading
---------
Upgrading Silex to the latest version is as easy as running the ``update``
command:
If you want more flexibility, use Composer_ instead:
.. code-block:: bash
$ php composer.phar update
composer require silex/silex:~1.2
Bootstrap
---------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment