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
df568cb2
Commit
df568cb2
authored
Nov 04, 2013
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added BootableProviderInterface
parent
1ba15a17
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
39 additions
and
72 deletions
+39
-72
src/Silex/Api/BootableProviderInterface.php
src/Silex/Api/BootableProviderInterface.php
+31
-0
src/Silex/Api/ServiceProviderInterface.php
src/Silex/Api/ServiceProviderInterface.php
+0
-9
src/Silex/Application.php
src/Silex/Application.php
+4
-1
src/Silex/Provider/DoctrineServiceProvider.php
src/Silex/Provider/DoctrineServiceProvider.php
+0
-4
src/Silex/Provider/FormServiceProvider.php
src/Silex/Provider/FormServiceProvider.php
+0
-4
src/Silex/Provider/HttpCacheServiceProvider.php
src/Silex/Provider/HttpCacheServiceProvider.php
+0
-4
src/Silex/Provider/HttpFragmentServiceProvider.php
src/Silex/Provider/HttpFragmentServiceProvider.php
+0
-4
src/Silex/Provider/MonologServiceProvider.php
src/Silex/Provider/MonologServiceProvider.php
+2
-1
src/Silex/Provider/RememberMeServiceProvider.php
src/Silex/Provider/RememberMeServiceProvider.php
+0
-4
src/Silex/Provider/SecurityServiceProvider.php
src/Silex/Provider/SecurityServiceProvider.php
+2
-1
src/Silex/Provider/SerializerServiceProvider.php
src/Silex/Provider/SerializerServiceProvider.php
+0
-11
src/Silex/Provider/ServiceControllerServiceProvider.php
src/Silex/Provider/ServiceControllerServiceProvider.php
+0
-5
src/Silex/Provider/SessionServiceProvider.php
src/Silex/Provider/SessionServiceProvider.php
+0
-4
src/Silex/Provider/SwiftmailerServiceProvider.php
src/Silex/Provider/SwiftmailerServiceProvider.php
+0
-4
src/Silex/Provider/TranslationServiceProvider.php
src/Silex/Provider/TranslationServiceProvider.php
+0
-4
src/Silex/Provider/TwigServiceProvider.php
src/Silex/Provider/TwigServiceProvider.php
+0
-4
src/Silex/Provider/UrlGeneratorServiceProvider.php
src/Silex/Provider/UrlGeneratorServiceProvider.php
+0
-4
src/Silex/Provider/ValidatorServiceProvider.php
src/Silex/Provider/ValidatorServiceProvider.php
+0
-4
No files found.
src/Silex/Api/BootableProviderInterface.php
0 → 100644
View file @
df568cb2
<?php
/*
* This file is part of the Silex framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Silex\Api
;
use
Silex\Application
;
/**
* Interface that must implement all Silex service providers.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface
BootableProviderInterface
{
/**
* Bootstraps the application.
*
* This method is called after all services are registered
* and should be used for "dynamic" configuration (whenever
* a service must be requested).
*/
public
function
boot
(
Application
$app
);
}
src/Silex/Api/ServiceProviderInterface.php
View file @
df568cb2
...
@@ -29,13 +29,4 @@ interface ServiceProviderInterface
...
@@ -29,13 +29,4 @@ interface ServiceProviderInterface
* @param Application $app An Application instance
* @param Application $app An Application instance
*/
*/
public
function
register
(
Application
$app
);
public
function
register
(
Application
$app
);
/**
* Bootstraps the application.
*
* This method is called after all services are registered
* and should be used for "dynamic" configuration (whenever
* a service must be requested).
*/
public
function
boot
(
Application
$app
);
}
}
src/Silex/Application.php
View file @
df568cb2
...
@@ -30,6 +30,7 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
...
@@ -30,6 +30,7 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
use
Symfony\Component\HttpFoundation\JsonResponse
;
use
Symfony\Component\HttpFoundation\JsonResponse
;
use
Symfony\Component\Routing\RouteCollection
;
use
Symfony\Component\Routing\RouteCollection
;
use
Symfony\Component\Routing\RequestContext
;
use
Symfony\Component\Routing\RequestContext
;
use
Silex\Api\BootableProviderInterface
;
use
Silex\Api\EventListenerProviderInterface
;
use
Silex\Api\EventListenerProviderInterface
;
use
Silex\Api\ControllerProviderInterface
;
use
Silex\Api\ControllerProviderInterface
;
use
Silex\Api\ServiceProviderInterface
;
use
Silex\Api\ServiceProviderInterface
;
...
@@ -189,10 +190,12 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
...
@@ -189,10 +190,12 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
$provider
->
subscribe
(
$this
,
$this
[
'dispatcher'
]);
$provider
->
subscribe
(
$this
,
$this
[
'dispatcher'
]);
}
}
if
(
$provider
instanceof
BootableProviderInterface
)
{
$provider
->
boot
(
$this
);
$provider
->
boot
(
$this
);
}
}
}
}
}
}
}
/**
/**
* Maps a pattern to a callable.
* Maps a pattern to a callable.
...
...
src/Silex/Provider/DoctrineServiceProvider.php
View file @
df568cb2
...
@@ -127,8 +127,4 @@ class DoctrineServiceProvider implements ServiceProviderInterface
...
@@ -127,8 +127,4 @@ class DoctrineServiceProvider implements ServiceProviderInterface
return
$dbs
[
$app
[
'dbs.default'
]];
return
$dbs
[
$app
[
'dbs.default'
]];
});
});
}
}
public
function
boot
(
Application
$app
)
{
}
}
}
src/Silex/Provider/FormServiceProvider.php
View file @
df568cb2
...
@@ -103,8 +103,4 @@ class FormServiceProvider implements ServiceProviderInterface
...
@@ -103,8 +103,4 @@ class FormServiceProvider implements ServiceProviderInterface
return
new
DefaultCsrfProvider
(
$app
[
'form.secret'
]);
return
new
DefaultCsrfProvider
(
$app
[
'form.secret'
]);
});
});
}
}
public
function
boot
(
Application
$app
)
{
}
}
}
src/Silex/Provider/HttpCacheServiceProvider.php
View file @
df568cb2
...
@@ -58,8 +58,4 @@ class HttpCacheServiceProvider implements ServiceProviderInterface, EventListene
...
@@ -58,8 +58,4 @@ class HttpCacheServiceProvider implements ServiceProviderInterface, EventListene
{
{
$dispatcher
->
addSubscriber
(
$app
[
'http_cache.esi_listener'
]);
$dispatcher
->
addSubscriber
(
$app
[
'http_cache.esi_listener'
]);
}
}
public
function
boot
(
Application
$app
)
{
}
}
}
src/Silex/Provider/HttpFragmentServiceProvider.php
View file @
df568cb2
...
@@ -82,8 +82,4 @@ class HttpFragmentServiceProvider implements ServiceProviderInterface, EventList
...
@@ -82,8 +82,4 @@ class HttpFragmentServiceProvider implements ServiceProviderInterface, EventList
{
{
$dispatcher
->
addSubscriber
(
$app
[
'fragment.listener'
]);
$dispatcher
->
addSubscriber
(
$app
[
'fragment.listener'
]);
}
}
public
function
boot
(
Application
$app
)
{
}
}
}
src/Silex/Provider/MonologServiceProvider.php
View file @
df568cb2
...
@@ -15,6 +15,7 @@ use Monolog\Logger;
...
@@ -15,6 +15,7 @@ use Monolog\Logger;
use
Monolog\Handler\StreamHandler
;
use
Monolog\Handler\StreamHandler
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\Api\ServiceProviderInterface
;
use
Silex\Api\ServiceProviderInterface
;
use
Silex\Api\BootableProviderInterface
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpFoundation\Response
;
...
@@ -26,7 +27,7 @@ use Silex\EventListener\LogListener;
...
@@ -26,7 +27,7 @@ use Silex\EventListener\LogListener;
*
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Fabien Potencier <fabien@symfony.com>
*/
*/
class
MonologServiceProvider
implements
ServiceProviderInterface
class
MonologServiceProvider
implements
ServiceProviderInterface
,
BootableProviderInterface
{
{
public
function
register
(
Application
$app
)
public
function
register
(
Application
$app
)
{
{
...
...
src/Silex/Provider/RememberMeServiceProvider.php
View file @
df568cb2
...
@@ -103,8 +103,4 @@ class RememberMeServiceProvider implements ServiceProviderInterface, EventListen
...
@@ -103,8 +103,4 @@ class RememberMeServiceProvider implements ServiceProviderInterface, EventListen
{
{
$dispatcher
->
addSubscriber
(
$app
[
'security.remember_me.response_listener'
]);
$dispatcher
->
addSubscriber
(
$app
[
'security.remember_me.response_listener'
]);
}
}
public
function
boot
(
Application
$app
)
{
}
}
}
src/Silex/Provider/SecurityServiceProvider.php
View file @
df568cb2
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\Api\BootableProviderInterface
;
use
Silex\Api\ControllerProviderInterface
;
use
Silex\Api\ControllerProviderInterface
;
use
Silex\Api\ServiceProviderInterface
;
use
Silex\Api\ServiceProviderInterface
;
use
Silex\Api\EventListenerProviderInterface
;
use
Silex\Api\EventListenerProviderInterface
;
...
@@ -60,7 +61,7 @@ use Symfony\Component\Security\Http\HttpUtils;
...
@@ -60,7 +61,7 @@ use Symfony\Component\Security\Http\HttpUtils;
*
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Fabien Potencier <fabien@symfony.com>
*/
*/
class
SecurityServiceProvider
implements
ServiceProviderInterface
,
EventListenerProviderInterface
,
ControllerProviderInterface
class
SecurityServiceProvider
implements
ServiceProviderInterface
,
EventListenerProviderInterface
,
ControllerProviderInterface
,
BootableProviderInterface
{
{
protected
$fakeRoutes
;
protected
$fakeRoutes
;
...
...
src/Silex/Provider/SerializerServiceProvider.php
View file @
df568cb2
...
@@ -49,15 +49,4 @@ class SerializerServiceProvider implements ServiceProviderInterface
...
@@ -49,15 +49,4 @@ class SerializerServiceProvider implements ServiceProviderInterface
return
array
(
new
CustomNormalizer
(),
new
GetSetMethodNormalizer
());
return
array
(
new
CustomNormalizer
(),
new
GetSetMethodNormalizer
());
});
});
}
}
/**
* {@inheritDoc}
*
* This provider does not execute any code when booting.
*
* @param Silex\Application $app
*/
public
function
boot
(
Application
$app
)
{
}
}
}
src/Silex/Provider/ServiceControllerServiceProvider.php
View file @
df568cb2
...
@@ -23,9 +23,4 @@ class ServiceControllerServiceProvider implements ServiceProviderInterface
...
@@ -23,9 +23,4 @@ class ServiceControllerServiceProvider implements ServiceProviderInterface
return
new
ServiceControllerResolver
(
$resolver
,
$app
[
'callback_resolver'
]);
return
new
ServiceControllerResolver
(
$resolver
,
$app
[
'callback_resolver'
]);
}));
}));
}
}
public
function
boot
(
Application
$app
)
{
// noop
}
}
}
src/Silex/Provider/SessionServiceProvider.php
View file @
df568cb2
...
@@ -85,8 +85,4 @@ class SessionServiceProvider implements ServiceProviderInterface, EventListenerP
...
@@ -85,8 +85,4 @@ class SessionServiceProvider implements ServiceProviderInterface, EventListenerP
$app
[
'dispatcher'
]
->
addSubscriber
(
$app
[
'session.listener.test'
]);
$app
[
'dispatcher'
]
->
addSubscriber
(
$app
[
'session.listener.test'
]);
}
}
}
}
public
function
boot
(
Application
$app
)
{
}
}
}
src/Silex/Provider/SwiftmailerServiceProvider.php
View file @
df568cb2
...
@@ -98,8 +98,4 @@ class SwiftmailerServiceProvider implements ServiceProviderInterface, EventListe
...
@@ -98,8 +98,4 @@ class SwiftmailerServiceProvider implements ServiceProviderInterface, EventListe
}
}
});
});
}
}
public
function
boot
(
Application
$app
)
{
}
}
}
src/Silex/Provider/TranslationServiceProvider.php
View file @
df568cb2
...
@@ -53,8 +53,4 @@ class TranslationServiceProvider implements ServiceProviderInterface
...
@@ -53,8 +53,4 @@ class TranslationServiceProvider implements ServiceProviderInterface
$app
[
'translator.domains'
]
=
array
();
$app
[
'translator.domains'
]
=
array
();
$app
[
'locale_fallbacks'
]
=
array
(
'en'
);
$app
[
'locale_fallbacks'
]
=
array
(
'en'
);
}
}
public
function
boot
(
Application
$app
)
{
}
}
}
src/Silex/Provider/TwigServiceProvider.php
View file @
df568cb2
...
@@ -106,8 +106,4 @@ class TwigServiceProvider implements ServiceProviderInterface
...
@@ -106,8 +106,4 @@ class TwigServiceProvider implements ServiceProviderInterface
));
));
});
});
}
}
public
function
boot
(
Application
$app
)
{
}
}
}
src/Silex/Provider/UrlGeneratorServiceProvider.php
View file @
df568cb2
...
@@ -30,8 +30,4 @@ class UrlGeneratorServiceProvider implements ServiceProviderInterface
...
@@ -30,8 +30,4 @@ class UrlGeneratorServiceProvider implements ServiceProviderInterface
return
new
UrlGenerator
(
$app
[
'routes'
],
$app
[
'request_context'
]);
return
new
UrlGenerator
(
$app
[
'routes'
],
$app
[
'request_context'
]);
});
});
}
}
public
function
boot
(
Application
$app
)
{
}
}
}
src/Silex/Provider/ValidatorServiceProvider.php
View file @
df568cb2
...
@@ -58,8 +58,4 @@ class ValidatorServiceProvider implements ServiceProviderInterface
...
@@ -58,8 +58,4 @@ class ValidatorServiceProvider implements ServiceProviderInterface
return
array
();
return
array
();
});
});
}
}
public
function
boot
(
Application
$app
)
{
}
}
}
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