X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FCore%2FContainer.php;h=f70369ad150eb5a373ef5c162ea39e32e720bd70;hb=378e2654b9f389f315fcf6a0c51ce649e7866971;hp=e251f2adf9e8f1739d18e4dfbebec8423a96966a;hpb=0a946de26c2e00af77e3593954f9edf248dfed14;p=civicrm-core.git diff --git a/Civi/Core/Container.php b/Civi/Core/Container.php index e251f2adf9..f70369ad15 100644 --- a/Civi/Core/Container.php +++ b/Civi/Core/Container.php @@ -13,6 +13,10 @@ use Symfony\Component\DependencyInjection\Reference; // TODO use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +/** + * Class Container + * @package Civi\Core + */ class Container { const SELF = 'civi_container_factory'; @@ -23,10 +27,11 @@ class Container { private static $singleton; /** + * @param bool $reset whether to forcibly rebuild the entire container * @return \Symfony\Component\DependencyInjection\TaggedContainerInterface */ - public static function singleton() { - if (self::$singleton === NULL) { + public static function singleton($reset = FALSE) { + if ($reset || self::$singleton === NULL) { $c = new self(); self::$singleton = $c->createContainer(); } @@ -35,6 +40,7 @@ class Container { /** * @var ContainerBuilder + * @return \Symfony\Component\DependencyInjection\ContainerBuilder */ public function createContainer() { $civicrm_base_path = dirname(dirname(__DIR__)); @@ -88,6 +94,8 @@ class Container { /** * @param \Symfony\Component\EventDispatcher\EventDispatcher $dispatcher + * @param $magicFunctionProvider + * * @return \Civi\API\Kernel */ public function createApiKernel($dispatcher, $magicFunctionProvider) {