当前位置: 首页>>代码示例>>PHP>>正文


PHP Marketplace::getAvailableMarketplaceItems方法代码示例

本文整理汇总了PHP中Marketplace::getAvailableMarketplaceItems方法的典型用法代码示例。如果您正苦于以下问题:PHP Marketplace::getAvailableMarketplaceItems方法的具体用法?PHP Marketplace::getAvailableMarketplaceItems怎么用?PHP Marketplace::getAvailableMarketplaceItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Marketplace的用法示例。


在下文中一共展示了Marketplace::getAvailableMarketplaceItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkPackageUpdates

 /** 
  * Runs through all packages on the marketplace, sees if they're installed here, and updates the available version number for them
  */
 public static function checkPackageUpdates()
 {
     Loader::model('system_notification');
     $items = Marketplace::getAvailableMarketplaceItems(false);
     foreach ($items as $i) {
         $p = Package::getByHandle($i->getHandle());
         if (is_object($p)) {
             // we only add a notification if it's newer than the last one we know about
             if (version_compare($p->getPackageVersionUpdateAvailable(), $i->getVersion(), '<') && version_compare($p->getPackageVersion(), $i->getVersion(), '<')) {
                 SystemNotification::add(SystemNotification::SN_TYPE_ADDON_UPDATE, t('An updated version of %s is available.', $i->getName()), t('New Version: %s.', $i->getVersion()), '', View::url('/dashboard/extend/update'), $i->getRemoteURL());
             }
             $p->updateAvailableVersionNumber($i->getVersion());
         }
     }
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:18,代码来源:marketplace.php

示例2: array_merge

				$coreBlockTypes[] = $_bt;
			} else {
				$webBlockTypes[] = $_bt;
			}
		}
	}
	$availableArray = array_merge($btAvailableArray, $pkgAvailableArray);
	usort($availableArray, 'sortAvailableArray');
	
	/* Load featured add-ons from the marketplace.
	 */
	Loader::model('collection_attributes');
	$db = Loader::db();
	
	if(ENABLE_MARKETPLACE_SUPPORT && $tp->canInstallPackages()){
		$purchasedBlocksSource = Marketplace::getAvailableMarketplaceItems();		
	}else{
		$purchasedBlocksSource = array();
	}
	
	// now we iterate through the purchased items (NOT BLOCKS, THESE CAN INCLUDE THEMES) list and removed ones already downloaded
	// This really should be made into a more generic object since it's not block types anymore.
	
	$skipHandles = array();
	foreach($availableArray as $ava) {
		foreach($purchasedBlocksSource as $pi) {
			if ($pi->getHandle() == $ava->getPackageHandle()) {
				$skipHandles[] = $ava->getPackageHandle();
			}
		}
	}
开发者ID:notzen,项目名称:concrete5,代码行数:31,代码来源:install.php


注:本文中的Marketplace::getAvailableMarketplaceItems方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。