Extensions do not need to know whether they are enabled

This commit is contained in:
Franz Liedke 2018-09-26 23:34:33 +02:00
parent 101cb1255d
commit b55ba61f79
2 changed files with 0 additions and 31 deletions

View File

@ -84,13 +84,6 @@ class Extension implements Arrayable
*/
protected $version;
/**
* Whether the extension is enabled.
*
* @var bool
*/
protected $enabled = false;
/**
* @param $path
* @param array $composerJson
@ -226,8 +219,6 @@ class Extension implements Arrayable
public function enable(Container $container)
{
$this->setEnabled(true);
foreach ($this->getLifecycleExtenders() as $extender) {
$extender->onEnable($container, $this);
}
@ -235,32 +226,11 @@ class Extension implements Arrayable
public function disable(Container $container)
{
$this->setEnabled(false);
foreach ($this->getLifecycleExtenders() as $extender) {
$extender->onDisable($container, $this);
}
}
/**
* @param bool $enabled
* @return Extension
*/
public function setEnabled($enabled)
{
$this->enabled = $enabled;
return $this;
}
/**
* @return bool
*/
public function isEnabled()
{
return $this->enabled;
}
/**
* The raw path of the directory under extensions.
*

View File

@ -83,7 +83,6 @@ class ExtensionManager
// Per default all extensions are installed if they are registered in composer.
$extension->setInstalled(true);
$extension->setVersion(Arr::get($package, 'version'));
$extension->setEnabled($this->isEnabled($extension->getId()));
$extensions->put($extension->getId(), $extension);
}