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
1dcc05dd
Commit
1dcc05dd
authored
May 20, 2012
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deprecated the phar
parent
fc44ff24
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
124 additions
and
116 deletions
+124
-116
compile
compile
+1
-1
doc/index.rst
doc/index.rst
+2
-1
doc/intro.rst
doc/intro.rst
+6
-6
doc/phar.rst
doc/phar.rst
+90
-0
doc/providers/doctrine.rst
doc/providers/doctrine.rst
+2
-2
doc/providers/monolog.rst
doc/providers/monolog.rst
+2
-2
doc/providers/swiftmailer.rst
doc/providers/swiftmailer.rst
+8
-3
doc/providers/translation.rst
doc/providers/translation.rst
+3
-2
doc/providers/twig.rst
doc/providers/twig.rst
+1
-1
doc/providers/validator.rst
doc/providers/validator.rst
+2
-2
doc/usage.rst
doc/usage.rst
+4
-87
example.htaccess
example.htaccess
+0
-8
src/Silex/Util/Compiler.php
src/Silex/Util/Compiler.php
+3
-1
No files found.
compile
View file @
1dcc05dd
...
...
@@ -3,7 +3,7 @@
require_once
__DIR__
.
'/vendor/autoload.php'
;
use
Silex\Compiler
;
use
Silex\Compiler
\Util
;
$compiler
=
new
Compiler
();
$compiler
->
compile
();
doc/index.rst
View file @
1dcc05dd
...
...
@@ -14,3 +14,4 @@ Silex
contributing
providers/index
changelog
phar
doc/intro.rst
View file @
1dcc05dd
...
...
@@ -22,7 +22,7 @@ step.
**Let's go!**::
require_once __DIR__.'/
silex.phar
';
require_once __DIR__.'/
vendor/autoload.php
';
$app = new Silex\Application();
...
...
@@ -32,8 +32,8 @@ step.
$app->run();
All that is needed to get access to the Framework is to include
``silex.phar``. This phar (PHP Archive) file will take care of the rest
.
All that is needed to get access to the Framework is to include
the
autoloader
.
Next we define a route to ``/hello/{name}`` that matches for ``GET``
requests. When the route matches, the function is executed and the return
...
...
@@ -42,7 +42,7 @@ value is sent back to the client.
Finally, the app is run. Visit ``/hello/world`` to see the result.
It's really that easy!
Installing Silex is as easy as it can get. Download the `silex.
phar`_ file
and you're done!
Installing Silex is as easy as it can get. Download the `silex.
zip`_ file,
unzip it,
and you're done!
.. _silex.
phar: http://silex.sensiolabs.org/get/silex.phar
.. _silex.
zip: http://silex.sensiolabs.org/get/silex.zip
doc/phar.rst
0 → 100644
View file @
1dcc05dd
Phar File
---------
.. caution::
Using the Silex ``phar`` file is deprecated. You should use Composer
instead to install Silex and its dependencies or download one of the
archives.
Console
~~~~~~~
Silex includes a lightweight console for updating to the latest version.
To find out which version of Silex you are using, invoke ``silex.phar`` on the
command-line with ``version`` as an argument:
.. code-block:: text
$ php silex.phar version
Silex version 0a243d3 2011-04-17 14:49:31 +0200
To check that your are using the latest version, run the ``check`` command:
.. code-block:: text
$ php silex.phar check
To update ``silex.phar`` to the latest version, invoke the ``update``
command:
.. code-block:: text
$ php silex.phar update
This will automatically download a new ``silex.phar`` from
``silex.sensiolabs.org`` and replace the existing one.
Pitfalls
~~~~~~~~
There are some things that can go wrong. Here we will try and outline the
most frequent ones.
PHP configuration
~~~~~~~~~~~~~~~~~
Certain PHP distributions have restrictive default Phar settings. Setting
the following may help.
.. code-block:: ini
detect_unicode = Off
phar.readonly = Off
phar.require_hash = Off
If you are on Suhosin you will also have to set this:
.. code-block:: ini
suhosin.executor.include.whitelist = phar
.. note::
Ubuntu's PHP ships with Suhosin, so if you are using Ubuntu, you will need
this change.
Phar-Stub bug
~~~~~~~~~~~~~
Some PHP installations have a bug that throws a ``PharException`` when trying
to include the Phar. It will also tell you that ``Silex\Application`` could not
be found. A workaround is using the following include line::
require_once 'phar://'.__DIR__.'/silex.phar/autoload.php';
The exact cause of this issue could not be determined yet.
ioncube loader bug
~~~~~~~~~~~~~~~~~~
Ioncube loader is an extension that can decode PHP encoded file.
Unfortunately, old versions (prior to version 4.0.9) are not working well
with phar archives.
You must either upgrade Ioncube loader to version 4.0.9 or newer or disable it
by commenting or removing this line in your php.ini file:
.. code-block:: ini
zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so
doc/providers/doctrine.rst
View file @
1dcc05dd
...
...
@@ -60,8 +60,8 @@ Registering
.. note::
Doctrine does not come with the ``silex
.zip`, so you need to add Doctrine
DBAL as a dependency to your ``composer.json`` file:
Doctrine does not come with the ``silex
`` archives, so you need to add
D
octrine D
BAL as a dependency to your ``composer.json`` file:
.. code-block:: json
...
...
doc/providers/monolog.rst
View file @
1dcc05dd
...
...
@@ -48,8 +48,8 @@ Registering
.. note::
Monolog does not come with the ``silex
.zip`, so you need to add it as a
dependency to your ``composer.json`` file:
Monolog does not come with the ``silex
`` archives, so you need to add it
as a
dependency to your ``composer.json`` file:
.. code-block:: json
...
...
doc/providers/swiftmailer.rst
View file @
1dcc05dd
...
...
@@ -23,6 +23,9 @@ Parameters
* **encryption**: SMTP encryption, defaults to null.
* **auth_mode**: SMTP authentication mode, defaults to null.
* **swiftmailer.class_path** (optional): Path to where the Swift Mailer
library is located.
Services
--------
...
...
@@ -54,12 +57,14 @@ Registering
.. code-block:: php
$app->register(new Silex\Provider\SwiftmailerServiceProvider());
$app->register(new Silex\Provider\SwiftmailerServiceProvider(), array(
'swiftmailer.class_path' => __DIR__.'/vendor/swiftmailer/swiftmailer/lib/classes',
));
.. note::
SwiftMailer does not come with the ``silex
.zip`, so you need to add it as
a dependency to your ``composer.json`` file:
SwiftMailer does not come with the ``silex
`` archives, so you need to add
it as
a dependency to your ``composer.json`` file:
.. code-block:: json
...
...
doc/providers/translation.rst
View file @
1dcc05dd
...
...
@@ -42,8 +42,9 @@ Registering
.. note::
The Symfony Translation component does not come with the ``silex.zip`, so
you need to add it as a dependency to your ``composer.json`` file:
The Symfony Translation component does not come with the ``silex``
archives, so you need to add it as a dependency to your ``composer.json``
file:
.. code-block:: json
...
...
doc/providers/twig.rst
View file @
1dcc05dd
...
...
@@ -44,7 +44,7 @@ Registering
.. note::
Twig does not come with the ``silex
.zip`
, so you need to add it as a
Twig does not come with the ``silex
`` archives
, so you need to add it as a
dependency to your ``composer.json`` file:
.. code-block:: json
...
...
doc/providers/validator.rst
View file @
1dcc05dd
...
...
@@ -37,8 +37,8 @@ Registering
.. note::
The Symfony Validator component does not come with the ``silex
.zip`, so
you need to add it as a dependency to your ``composer.json`` file:
The Symfony Validator component does not come with the ``silex
`` archives,
so
you need to add it as a dependency to your ``composer.json`` file:
.. code-block:: json
...
...
doc/usage.rst
View file @
1dcc05dd
...
...
@@ -6,11 +6,11 @@ This chapter describes how to use Silex.
Bootstrap
---------
To
include the Silex all you need to do is require the ``silex.phar
``
file and create an instance of ``Silex\Application``. After your
controller
definitions, call the ``run`` method on your application::
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
definitions, call the ``run`` method on your application::
require_once __DIR__.'/
silex.phar
';
require_once __DIR__.'/
vendor/autoload.php
';
$app = new Silex\Application();
...
...
@@ -718,89 +718,6 @@ correctly, to prevent Cross-Site-Scripting attacks.
return $app->json(array('name' => $name));
});
Console
-------
Silex includes a lightweight console for updating to the latest
version.
To find out which version of Silex you are using, invoke ``silex.phar`` on the
command-line with ``version`` as an argument:
.. code-block:: text
$ php silex.phar version
Silex version 0a243d3 2011-04-17 14:49:31 +0200
To check that your are using the latest version, run the ``check`` command:
.. code-block:: text
$ php silex.phar check
To update ``silex.phar`` to the latest version, invoke the ``update``
command:
.. code-block:: text
$ php silex.phar update
This will automatically download a new ``silex.phar`` from
``silex.sensiolabs.org`` and replace the existing one.
Pitfalls
--------
There are some things that can go wrong. Here we will try and outline the
most frequent ones.
PHP configuration
~~~~~~~~~~~~~~~~~
Certain PHP distributions have restrictive default Phar settings. Setting
the following may help.
.. code-block:: ini
detect_unicode = Off
phar.readonly = Off
phar.require_hash = Off
If you are on Suhosin you will also have to set this:
.. code-block:: ini
suhosin.executor.include.whitelist = phar
.. note::
Ubuntu's PHP ships with Suhosin, so if you are using Ubuntu, you will need
this change.
Phar-Stub bug
~~~~~~~~~~~~~
Some PHP installations have a bug that throws a ``PharException`` when trying
to include the Phar. It will also tell you that ``Silex\Application`` could not
be found. A workaround is using the following include line::
require_once 'phar://'.__DIR__.'/silex.phar/autoload.php';
The exact cause of this issue could not be determined yet.
ioncube loader bug
~~~~~~~~~~~~~~~~~~
Ioncube loader is an extension that can decode PHP encoded file.
Unfortunately, old versions (prior to version 4.0.9) are not working well
with phar archives.
You must either upgrade Ioncube loader to version 4.0.9 or newer or disable it
by commenting or removing this line in your php.ini file:
.. code-block:: ini
zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so
Apache configuration
--------------------
...
...
example.htaccess
deleted
100644 → 0
View file @
fc44ff24
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
#RewriteBase /path/to/app
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
src/Silex/Compiler.php
→
src/Silex/
Util/
Compiler.php
View file @
1dcc05dd
...
...
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace
Silex
;
namespace
Silex
\Util
;
use
Symfony\Component\Finder\Finder
;
use
Symfony\Component\HttpKernel\Kernel
;
...
...
@@ -18,6 +18,8 @@ use Symfony\Component\Process\Process;
/**
* The Compiler class compiles the Silex framework.
*
* This is deprecated. Use composer instead.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class
Compiler
...
...
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