Move events handling to Symfony\EventDispatcher

This commit is contained in:
Frédéric Guillot
2014-12-27 19:10:38 -05:00
parent cf821e117c
commit 17dc5bdc9e
75 changed files with 1076 additions and 1167 deletions

View File

@@ -3,7 +3,6 @@
namespace Controller;
use Pimple\Container;
use Core\Tool;
use Core\Security;
use Core\Request;
use Core\Response;
@@ -129,7 +128,7 @@ abstract class Base
*/
public function __get($name)
{
return Tool::loadModel($this->container, $name);
return $this->container[$name];
}
/**
@@ -156,9 +155,6 @@ abstract class Base
$this->response->hsts();
}
$this->config->setupTranslations();
$this->config->setupTimezone();
// Authentication
if (! $this->authentication->isAuthenticated($controller, $action)) {
@@ -173,30 +169,6 @@ abstract class Base
if (! $this->acl->isPageAccessAllowed($controller, $action)) {
$this->response->redirect('?controller=user&action=forbidden');
}
// Attach events
$this->attachEvents();
}
/**
* Attach events
*
* @access private
*/
private function attachEvents()
{
$models = array(
'projectActivity', // Order is important
'projectDailySummary',
'action',
'project',
'webhook',
'notification',
);
foreach ($models as $model) {
$this->$model->attachEvents();
}
}
/**