當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Package::getRemotelyUpgradeablePackages方法代碼示例

本文整理匯總了PHP中Package::getRemotelyUpgradeablePackages方法的典型用法代碼示例。如果您正苦於以下問題:PHP Package::getRemotelyUpgradeablePackages方法的具體用法?PHP Package::getRemotelyUpgradeablePackages怎麽用?PHP Package::getRemotelyUpgradeablePackages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Package的用法示例。


在下文中一共展示了Package::getRemotelyUpgradeablePackages方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: view

 public function view()
 {
     Loader::library('update');
     $this->set('latest_version', Update::getLatestAvailableVersionNumber());
     $tp = new TaskPermission();
     $updates = 0;
     $local = array();
     $remote = array();
     if ($tp->canInstallPackages()) {
         $local = Package::getLocalUpgradeablePackages();
         $remote = Package::getRemotelyUpgradeablePackages();
     }
     // now we strip out any dupes for the total
     $updates = 0;
     $localHandles = array();
     foreach ($local as $_pkg) {
         $updates++;
         $localHandles[] = $_pkg->getPackageHandle();
     }
     foreach ($remote as $_pkg) {
         if (!in_array($_pkg->getPackageHandle(), $localHandles)) {
             $updates++;
         }
     }
     $this->set('updates', $updates);
 }
開發者ID:Zyqsempai,項目名稱:amanet,代碼行數:26,代碼來源:dashboard_app_status.php

示例2: view

 public function view()
 {
     $this->set('latest_version', Config::get('APP_VERSION_LATEST'));
     $tp = new TaskPermission();
     $updates = 0;
     $local = array();
     $remote = array();
     if ($tp->canInstallPackages()) {
         $local = Package::getLocalUpgradeablePackages();
         $remote = Package::getRemotelyUpgradeablePackages();
     }
     // now we strip out any dupes for the total
     $updates = 0;
     $localHandles = array();
     foreach ($local as $_pkg) {
         $updates++;
         $localHandles[] = $_pkg->getPackageHandle();
     }
     foreach ($remote as $_pkg) {
         if (!in_array($_pkg->getPackageHandle(), $localHandles)) {
             $updates++;
         }
     }
     $this->set('updates', $updates);
 }
開發者ID:rmxdave,項目名稱:concrete5,代碼行數:25,代碼來源:controller.php

示例3: sortAvailableArray

	function sortAvailableArray($obj1, $obj2) {
		$name1 = ($obj1 instanceof Package) ? $obj1->getPackageName() : $obj1->getBlockTypeName();
		$name2 = ($obj2 instanceof Package) ? $obj2->getPackageName() : $obj2->getBlockTypeName();
		return strcasecmp($name1, $name2);
	}
	
	// grab the total numbers of updates.
	// this consists of 
	// 1. All packages that have greater pkgAvailableVersions than pkgVersion
	// 2. All packages that have greater pkgVersion than getPackageCurrentlyInstalledVersion
	$local = array();
	$remote = array();
	$pkgAvailableArray = array();
	if ($tp->canInstallPackages()) { 
		$local = Package::getLocalUpgradeablePackages();
		$remote = Package::getRemotelyUpgradeablePackages();
	}
	
	// now we strip out any dupes for the total
	$updates = 0;
	$localHandles = array();
	foreach($local as $_pkg) {
		$updates++;
		$localHandles[] = $_pkg->getPackageHandle();
	}
	foreach($remote as $_pkg) {
		if (!in_array($_pkg->getPackageHandle(), $localHandles)) {
			$updates++;
		}
	}
	if ($tp->canInstallPackages()) { 
開發者ID:notzen,項目名稱:concrete5,代碼行數:31,代碼來源:install.php


注:本文中的Package::getRemotelyUpgradeablePackages方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。