moduleList = $moduleList; $this->addData( ['cache_lifetime' => 86400, 'cache_tags' => [self::CACHE_TAG]] ); } /** * @return array */ public function getInstalledModules() { $mageplza_modules = []; foreach ($this->moduleList->getAll() as $moduleName => $info) { if (strpos($moduleName, 'Mageplaza') !== false) { $mageplza_modules[$moduleName] = $info['setup_version']; } } return $mageplza_modules; } /** * @return bool|mixed|string */ public function getAvailableModules() { $result = $this->_loadCache(); if (!$result) { try { $result = file_get_contents(self::API_URL); $this->_saveCache($result); } catch (\Exception $e) { return false; } } $result = json_decode($result, true); //true return array otherwise object return $result; } }