src/ExtensionsManager.php
public function getExtensions($packageName = '', $ignoreCache = false)
    {
        if (count($this->_extensions) === 0 || true === $ignoreCache) {
            $fileName = Yii::getAlias($this->extensionsStorage);
            $canLoad = false;
            if (true === file_exists($fileName) && true === is_readable($fileName)) {
                $canLoad = true;
            } else {
                $canLoad = ExtensionFileWriter::generateConfig();
            }
            if (true === $canLoad) {
                $this->_extensions = include $fileName;
            } else {
                Yii::$app->session->setFlash('error', Yii::t('extensions-manager', 'Unable to create extensions file'));
            }
        }
        if (false === empty($packageName)) {
            return isset($this->_extensions[$packageName]) ? $this->_extensions[$packageName] : [];
        }
        return $this->_extensions;
    }
public function getExtensions($packageName = '', $ignoreCache = false)
    {
        if (count($this->_extensions) === 0 || true === $ignoreCache) {
            $fileName = Yii::getAlias($this->extensionsStorage);
            $canLoad = false;
            if (true === file_exists($fileName) && true === is_readable($fileName)) {
                $canLoad = true;
            } else {
                $canLoad = ExtensionFileWriter::generateConfig();
            }
            if (true === $canLoad) {
                $this->_extensions = include $fileName;
            } else {
                Yii::$app->session->setFlash('error', Yii::t('extensions-manager', 'Unable to create extensions file'));
            }
        }
        if (false === empty($packageName)) {
            return isset($this->_extensions[$packageName]) ? $this->_extensions[$packageName] : [];
        }
        return $this->_extensions;
    }
Returns Extension[] or one Extension array by package name found in self::$extensionsStorage.

@param string $packageName
@param bool $ignoreCache
@return Extension|models\Extension[]