summaryrefslogtreecommitdiff
path: root/app/Event
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-11-14 22:44:25 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-11-14 22:44:25 -0500
commitb081288188bb1744c9d7bd075aa5936e0ccbb9c4 (patch)
tree68008e35eb129f74b9b2a49f6f6076ed02b601c6 /app/Event
parent1487cb27634161ef558c367150213bc7077e4198 (diff)
Use Pimple instead of Core\Registry and add Monolog for logging
Diffstat (limited to 'app/Event')
-rw-r--r--app/Event/Base.php16
-rw-r--r--app/Event/ProjectActivityListener.php2
2 files changed, 9 insertions, 9 deletions
diff --git a/app/Event/Base.php b/app/Event/Base.php
index 745871a5..5381471a 100644
--- a/app/Event/Base.php
+++ b/app/Event/Base.php
@@ -2,8 +2,8 @@
namespace Event;
+use Pimple\Container;
use Core\Listener;
-use Core\Registry;
use Core\Tool;
/**
@@ -25,19 +25,19 @@ abstract class Base implements Listener
* Registry instance
*
* @access protected
- * @var \Core\Registry
+ * @var Pimple\Container
*/
- protected $registry;
+ protected $container;
/**
* Constructor
*
* @access public
- * @param \Core\Registry $registry Regsitry instance
+ * @param Pimple\Container $container
*/
- public function __construct(Registry $registry)
+ public function __construct(Container $container)
{
- $this->registry = $registry;
+ $this->container = $container;
}
/**
@@ -60,7 +60,7 @@ abstract class Base implements Listener
*/
public function __get($name)
{
- return Tool::loadModel($this->registry, $name);
+ return Tool::loadModel($this->container, $name);
}
/**
@@ -73,7 +73,7 @@ abstract class Base implements Listener
*/
public function getEventNamespace()
{
- $event_name = $this->registry->event->getLastTriggeredEvent();
+ $event_name = $this->container['event']->getLastTriggeredEvent();
return substr($event_name, 0, strpos($event_name, '.'));
}
}
diff --git a/app/Event/ProjectActivityListener.php b/app/Event/ProjectActivityListener.php
index 8958bd2b..75efe65d 100644
--- a/app/Event/ProjectActivityListener.php
+++ b/app/Event/ProjectActivityListener.php
@@ -27,7 +27,7 @@ class ProjectActivityListener extends Base
$values['task']['project_id'],
$values['task']['id'],
$this->acl->getUserId(),
- $this->registry->event->getLastTriggeredEvent(),
+ $this->container['event']->getLastTriggeredEvent(),
$values
);
}