/**
  * @inheritdoc
  */
 public function beforeActionRun()
 {
     parent::beforeActionRun();
     $this->configurables = ExtensionsHelper::getConfigurables(true);
     $this->sectionIndex = Yii::$app->request->get('sectionIndex', 0);
     if (isset($this->configurables[$this->sectionIndex]) === false) {
         $this->sectionIndex = 0;
     }
     $this->sectionIndex = intval($this->sectionIndex);
     $this->currentConfigurable = isset($this->configurables[$this->sectionIndex]) ? $this->configurables[$this->sectionIndex] : null;
     if ($this->currentConfigurable !== null && ExtensionsManager::module()->extensionIsCore($this->currentConfigurable['package']) && !Yii::$app->user->can('extensions-manager-access-to-core-extension')) {
         throw new ForbiddenHttpException();
     }
     if (null !== $this->currentConfigurable) {
         $this->currentConfigurationModel = ArrayHelper::getValue($this->currentConfigurable, 'configurationModel');
         $this->currentConfigurationView = ArrayHelper::getValue($this->currentConfigurable, 'configurationView');
     }
     if ($this->currentConfigurationView !== null && $this->currentConfigurationModel !== null) {
         $this->isValidSection = true;
         $this->currentConfigurationView = '@vendor/' . $this->currentConfigurable['package'] . '/' . $this->currentConfigurationView;
         $this->model = new $this->currentConfigurationModel();
         $configurablesStatePath = ExtensionsManager::module()->configurationUpdater->configurablesStatePath;
         $this->model->loadState($configurablesStatePath);
     } else {
         $this->currentConfigurationView = '_default_configuraton.php';
     }
 }
 /**
  * Returns configurables sections.
  * Loads them from files if not loaded.
  * @param bool $ignoreCache
  */
 protected function getConfigurables($ignoreCache = false)
 {
     if (count($this->_configurables) === 0 || true === $ignoreCache) {
         $this->_configurables = ExtensionsHelper::getConfigurables();
     }
 }
 public function testGetOnlyActive()
 {
     $this->assertEquals(1, count(ExtensionsHelper::getConfigurables(true)));
 }