For example is when a logger is registered and it's auto_shutdown
method is delegated to a global auto_shutdown method. I think checking
if the logger is instantiated is necessary because it will be created
unnecessarily just for it to be shutdown

$sc = new sfServiceContainerBuilder();

$sc->register('dispatcher', 'sfEventDispatcher');

$sc->register('logger', 'sfAggregateLogger')
  ->addArgument(new sfServiceReference('dispatcher'))
  ->addArgument(array('level' => 'debug', 'auto_shutdown' => false));

register_shutdown_function('shutdown', $sc);

function shutdown()
{
  //will created logger instance even when it wasn't used at all
  $sc->logger->shutdown();
}

On Apr 12, 3:46 pm, Fabien Potencier <fabien.potenc...@symfony-
project.com> wrote:
> What for? There is no need to know if a service has been instantiated,
> especially if it is not shared, where it does not make any sense.
>
> Fabien
>
> --
> Fabien Potencier
> Sensio CEO - symfony lead developer
> sensiolabs.com | symfony-project.org | fabien.potencier.org
> Tél: +33 1 40 99 80 80
>
> Ken Marfilla wrote:
> > bump again.
>
> > On Apr 9, 3:53 pm, Ken Marfilla <[email protected]> wrote:
> >> bump
>
> >> On Apr 4, 1:49 pm, ken <[email protected]> wrote:
>
> >>> The service container can only detect if a service is registered via
> >>> hasService method. Is there a way to know if the said service has been
> >>> instanciated?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to