// TODO use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+/**
+ * Class Container
+ * @package Civi\Core
+ */
class Container {
const SELF = 'civi_container_factory';
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();
}
/**
* @var ContainerBuilder
+ * @return \Symfony\Component\DependencyInjection\ContainerBuilder
*/
public function createContainer() {
$civicrm_base_path = dirname(dirname(__DIR__));
*/
public function createEventDispatcher() {
$dispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher();
+ $dispatcher->addListener('hook_civicrm_post::Activity', array('\Civi\CCase\Events', 'fireCaseChange'));
+ //$dispatcher->addListener('hook_civicrm_post::Case', array('\Civi\CCase\Events', 'fireCaseChange'));
+ $dispatcher->addListener('hook_civicrm_caseChange', array('\Civi\CCase\Events', 'delegateToXmlListeners'));
+ $dispatcher->addListener('hook_civicrm_caseChange', array('\Civi\CCase\SequenceListener', 'onCaseChange_static'));
return $dispatcher;
}
/**
* @param \Symfony\Component\EventDispatcher\EventDispatcher $dispatcher
+ * @param $magicFunctionProvider
+ *
* @return \Civi\API\Kernel
*/
public function createApiKernel($dispatcher, $magicFunctionProvider) {