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
eb5079be
Commit
eb5079be
authored
Nov 03, 2013
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved fake routes for the security service provider to a connect() method (with auto-registration)
parent
3fdfa4be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
src/Silex/Provider/SecurityServiceProvider.php
src/Silex/Provider/SecurityServiceProvider.php
+12
-3
No files found.
src/Silex/Provider/SecurityServiceProvider.php
View file @
eb5079be
...
...
@@ -12,6 +12,7 @@
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\ControllerProviderInterface
;
use
Silex\ServiceProviderInterface
;
use
Silex\EventListenerProviderInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
...
...
@@ -59,7 +60,7 @@ use Symfony\Component\Security\Http\HttpUtils;
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class
SecurityServiceProvider
implements
ServiceProviderInterface
,
EventListenerProviderInterface
class
SecurityServiceProvider
implements
ServiceProviderInterface
,
EventListenerProviderInterface
,
ControllerProviderInterface
{
protected
$fakeRoutes
;
...
...
@@ -542,13 +543,21 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
$dispatcher
->
addSubscriber
(
$app
[
'security.firewall'
]);
}
public
function
boo
t
(
Application
$app
)
public
function
connec
t
(
Application
$app
)
{
$controllers
=
$app
[
'controllers_factory'
];
foreach
(
$this
->
fakeRoutes
as
$route
)
{
list
(
$method
,
$pattern
,
$name
)
=
$route
;
$app
->
$method
(
$pattern
)
->
run
(
null
)
->
bind
(
$name
);
$controllers
->
$method
(
$pattern
)
->
run
(
null
)
->
bind
(
$name
);
}
return
$controllers
;
}
public
function
boot
(
Application
$app
)
{
$app
->
mount
(
'/'
,
$this
->
connect
(
$app
));
}
public
function
addFakeRoute
(
$method
,
$pattern
,
$name
)
...
...
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