public function view() { $this->set('latest_version', Update::getLatestAvailableVersionNumber()); $local = []; $remote = []; $p = new Permissions(); if ($p->canInstallPackages()) { $local = Package::getLocalUpgradeablePackages(); $remote = Package::getRemotelyUpgradeablePackages(); } // now we strip out any dupes for the total $updates = 0; $localHandles = []; foreach ($local as $_pkg) { ++$updates; $localHandles[] = $_pkg->getPackageHandle(); } foreach ($remote as $_pkg) { if (!in_array($_pkg->getPackageHandle(), $localHandles)) { ++$updates; } } $this->set('updates', $updates); }
/** * @deprecated */ public static function getRemotelyUpgradeablePackages() { // this should go through the facade instead return \Concrete\Core\Support\Facade\Package::getRemotelyUpgradeablePackages(); }