コード例 #1
0
 /**
  * Loops the update list and checks for actionable updates.
  */
 protected function processImportantUpdates($result)
 {
     $hasImportantUpdates = false;
     foreach (array_get($result, 'plugins', []) as $code => $plugin) {
         $isImportant = false;
         foreach (array_get($plugin, 'updates', []) as $version => $description) {
             if (strpos($description, '!!!') === false) {
                 continue;
             }
             $isImportant = $hasImportantUpdates = true;
             $detailsUrl = Backend::url('system/updates/details/' . PluginVersion::makeSlug($code) . '/upgrades') . '?fetch=1';
             $description = str_replace('!!!', '', $description);
             $result['plugins'][$code]['updates'][$version] = [$description, $detailsUrl];
         }
         $result['plugins'][$code]['isImportant'] = $isImportant ? '1' : '0';
     }
     $result['hasImportantUpdates'] = $hasImportantUpdates;
     return $result;
 }