crowl all module descriptor file for discovering new modules

This commit is contained in:
Manuel Raynaud
2013-10-17 15:36:11 +02:00
parent a9d5554b7c
commit 1b865d71a3
4 changed files with 18 additions and 7 deletions

View File

@@ -43,6 +43,8 @@ abstract class BaseModule extends ContainerAware
const IS_ACTIVATED = 1;
const IS_NOT_ACTIVATED = 0;
protected $reflected;
public function __construct()
{
@@ -178,7 +180,16 @@ abstract class BaseModule extends ContainerAware
return $moduleModel;
}
abstract public function getCode();
public function getCode()
{
if (null === $this->reflected) {
$this->reflected = new \ReflectionObject($this);
}
return dirname($this->reflected->getFileName());
}
abstract public function install();
abstract public function afterActivation();
abstract public function destroy();