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
fb1e41e5
Commit
fb1e41e5
authored
Apr 11, 2015
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed deprecated features, BC layers
parent
55bbb1ef
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
14 additions
and
88 deletions
+14
-88
doc/contributing.rst
doc/contributing.rst
+0
-16
doc/usage.rst
doc/usage.rst
+1
-10
doc/web_servers.rst
doc/web_servers.rst
+5
-6
src/Silex/ExceptionHandler.php
src/Silex/ExceptionHandler.php
+0
-12
src/Silex/Provider/RememberMeServiceProvider.php
src/Silex/Provider/RememberMeServiceProvider.php
+1
-1
src/Silex/Provider/SecurityServiceProvider.php
src/Silex/Provider/SecurityServiceProvider.php
+6
-22
src/Silex/Provider/TranslationServiceProvider.php
src/Silex/Provider/TranslationServiceProvider.php
+0
-6
tests/Silex/Tests/Application/FormTraitTest.php
tests/Silex/Tests/Application/FormTraitTest.php
+0
-2
tests/Silex/Tests/Application/MonologTraitTest.php
tests/Silex/Tests/Application/MonologTraitTest.php
+0
-2
tests/Silex/Tests/Application/SecurityTraitTest.php
tests/Silex/Tests/Application/SecurityTraitTest.php
+0
-2
tests/Silex/Tests/Application/SwiftmailerTraitTest.php
tests/Silex/Tests/Application/SwiftmailerTraitTest.php
+0
-2
tests/Silex/Tests/Application/TranslationTraitTest.php
tests/Silex/Tests/Application/TranslationTraitTest.php
+0
-2
tests/Silex/Tests/Application/TwigTraitTest.php
tests/Silex/Tests/Application/TwigTraitTest.php
+0
-2
tests/Silex/Tests/Application/UrlGeneratorTraitTest.php
tests/Silex/Tests/Application/UrlGeneratorTraitTest.php
+0
-2
tests/Silex/Tests/ExceptionHandlerTest.php
tests/Silex/Tests/ExceptionHandlerTest.php
+1
-1
No files found.
doc/contributing.rst
View file @
fb1e41e5
...
...
@@ -26,22 +26,6 @@ please join us on the `mailing list
Any code you contribute must be licensed under the MIT
License.
Target branch
=============
Before you create a pull request for Silex, you need to determine which branch
to submit it to. Read this section carefully first.
Silex has two active branches: `1.0` and `master` (`1.1`).
* **1.0**: Bugfixes and documentation fixes go into the 1.0 branch. 1.0 is
periodically merged into master. The 1.0 branch targets versions 2.1, 2.2 and
2.3 of Symfony2.
* **1.1**: All new features go into the 1.1 branch. Changes cannot break
backward compatibility. The 1.1 branch targets the 2.3 version of Symfony2.
Writing Documentation
=====================
...
...
doc/usage.rst
View file @
fb1e41e5
...
...
@@ -215,8 +215,7 @@ methods on your application: ``get``, ``post``, ``put``, ``delete``::
<input type="hidden" id="_method" name="_method" value="PUT" />
</form>
If you are using Symfony Components 2.2+, you will need to explicitly
enable this method override::
You need to explicitly enable this method override::
use Symfony\Component\HttpFoundation\Request;
...
...
@@ -685,19 +684,11 @@ To further customize the response before returning it, check the API doc for
->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, 'pic.jpg')
;
.. note::
HttpFoundation 2.2 or greater is required for this feature to be available.
Traits
------
Silex comes with PHP traits that define shortcut methods.
.. caution::
You need to use PHP 5.4 or later to benefit from this feature.
Almost all built-in service providers have some corresponding PHP traits. To
use them, define your own Application class and include the traits you want::
...
...
doc/web_servers.rst
View file @
fb1e41e5
...
...
@@ -120,13 +120,12 @@ point:
.. _FallbackResource directive: http://www.adayinthelifeof.nl/2012/01/21/apaches-fallbackresource-your-new-htaccess-command/
PHP
5.4
---
----
PHP
---
PHP 5.4 ships with a built-in webserver for development. This server allows
you to run silex without any configuration. However, in order to serve static
files, you'll have to make sure your front controller returns false in that
case::
PHP ships with a built-in webserver for development. This server allows you to
run silex without any configuration. However, in order to serve static files,
you'll have to make sure your front controller returns false in that case::
// web/index.php
...
...
src/Silex/ExceptionHandler.php
View file @
fb1e41e5
...
...
@@ -32,20 +32,8 @@ class ExceptionHandler implements EventSubscriberInterface
$this
->
enabled
=
true
;
}
/**
* @deprecated since 1.3, to be removed in 2.0
*/
public
function
disable
()
{
$this
->
enabled
=
false
;
}
public
function
onSilexError
(
GetResponseForExceptionEvent
$event
)
{
if
(
!
$this
->
enabled
)
{
return
;
}
$handler
=
new
DebugExceptionHandler
(
$this
->
debug
);
$event
->
setResponse
(
$handler
->
createResponse
(
$event
->
getException
()));
...
...
src/Silex/Provider/RememberMeServiceProvider.php
View file @
fb1e41e5
...
...
@@ -30,7 +30,7 @@ class RememberMeServiceProvider implements ServiceProviderInterface, EventListen
public
function
register
(
Container
$app
)
{
$app
[
'security.remember_me.response_listener'
]
=
function
(
$app
)
{
if
(
!
isset
(
$app
[
'security'
]))
{
if
(
!
isset
(
$app
[
'security
.token_storage
'
]))
{
throw
new
\LogicException
(
'You must register the SecurityServiceProvider to use the RememberMeServiceProvider'
);
}
...
...
src/Silex/Provider/SecurityServiceProvider.php
View file @
fb1e41e5
...
...
@@ -82,7 +82,6 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
$r
=
new
\ReflectionMethod
(
'Symfony\Component\Security\Http\Firewall\ContextListener'
,
'__construct'
);
$params
=
$r
->
getParameters
();
if
(
'Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'
===
$params
[
0
]
->
getClass
()
->
getName
())
{
$app
[
'security.authorization_checker'
]
=
function
(
$app
)
{
return
new
AuthorizationChecker
(
$app
[
'security.token_storage'
],
$app
[
'security.authentication_manager'
],
$app
[
'security.access_manager'
]);
};
...
...
@@ -91,21 +90,6 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
return
new
TokenStorage
();
};
$app
[
'security'
]
=
function
(
$app
)
{
// Deprecated, to be removed in 2.0
return
new
SecurityContext
(
$app
[
'security.token_storage'
],
$app
[
'security.authorization_checker'
]);
};
}
else
{
$app
[
'security.token_storage'
]
=
$app
[
'security.authorization_checker'
]
=
function
(
$app
)
{
return
$app
[
'security'
];
};
$app
[
'security'
]
=
function
(
$app
)
{
// Deprecated, to be removed in 2.0
return
new
SecurityContext
(
$app
[
'security.authentication_manager'
],
$app
[
'security.access_manager'
]);
};
}
$app
[
'security.authentication_manager'
]
=
function
(
$app
)
{
$manager
=
new
AuthenticationProviderManager
(
$app
[
'security.authentication_providers'
]);
$manager
->
setEventDispatcher
(
$app
[
'dispatcher'
]);
...
...
src/Silex/Provider/TranslationServiceProvider.php
View file @
fb1e41e5
...
...
@@ -36,12 +36,6 @@ class TranslationServiceProvider implements ServiceProviderInterface, EventListe
}
$translator
=
new
Translator
(
$app
[
'locale'
],
$app
[
'translator.message_selector'
],
$app
[
'translator.cache_dir'
],
$app
[
'debug'
]);
// Handle deprecated 'locale_fallback'
if
(
isset
(
$app
[
'locale_fallback'
]))
{
$app
[
'locale_fallbacks'
]
=
(
array
)
$app
[
'locale_fallback'
];
}
$translator
->
setFallbackLocales
(
$app
[
'locale_fallbacks'
]);
$translator
->
addLoader
(
'array'
,
new
ArrayLoader
());
$translator
->
addLoader
(
'xliff'
,
new
XliffFileLoader
());
...
...
tests/Silex/Tests/Application/FormTraitTest.php
View file @
fb1e41e5
...
...
@@ -17,8 +17,6 @@ use Silex\Provider\FormServiceProvider;
* FormTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class
FormTraitTest
extends
\PHPUnit_Framework_TestCase
{
...
...
tests/Silex/Tests/Application/MonologTraitTest.php
View file @
fb1e41e5
...
...
@@ -19,8 +19,6 @@ use Monolog\Logger;
* MonologTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class
MonologTraitTest
extends
\PHPUnit_Framework_TestCase
{
...
...
tests/Silex/Tests/Application/SecurityTraitTest.php
View file @
fb1e41e5
...
...
@@ -20,8 +20,6 @@ use Symfony\Component\HttpFoundation\Request;
* SecurityTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class
SecurityTraitTest
extends
\PHPUnit_Framework_TestCase
{
...
...
tests/Silex/Tests/Application/SwiftmailerTraitTest.php
View file @
fb1e41e5
...
...
@@ -17,8 +17,6 @@ use Silex\Provider\SwiftmailerServiceProvider;
* SwiftmailerTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class
SwiftmailerTraitTest
extends
\PHPUnit_Framework_TestCase
{
...
...
tests/Silex/Tests/Application/TranslationTraitTest.php
View file @
fb1e41e5
...
...
@@ -17,8 +17,6 @@ use Silex\Provider\TranslationServiceProvider;
* TranslationTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class
TranslationTraitTest
extends
\PHPUnit_Framework_TestCase
{
...
...
tests/Silex/Tests/Application/TwigTraitTest.php
View file @
fb1e41e5
...
...
@@ -19,8 +19,6 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
* TwigTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class
TwigTraitTest
extends
\PHPUnit_Framework_TestCase
{
...
...
tests/Silex/Tests/Application/UrlGeneratorTraitTest.php
View file @
fb1e41e5
...
...
@@ -19,8 +19,6 @@ use Silex\Provider\UrlGeneratorServiceProvider;
* UrlGeneratorTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class
UrlGeneratorTraitTest
extends
\PHPUnit_Framework_TestCase
{
...
...
tests/Silex/Tests/ExceptionHandlerTest.php
View file @
fb1e41e5
...
...
@@ -189,7 +189,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
public
function
testNoResponseExceptionHandler
()
{
$app
=
new
Application
();
$app
[
'exception_handler'
]
->
disable
(
);
unset
(
$app
[
'exception_handler'
]
);
$app
->
match
(
'/foo'
,
function
()
{
throw
new
\RuntimeException
(
'foo exception'
);
...
...
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