本文整理汇总了PHP中eZPackage::fetchPackages方法的典型用法代码示例。如果您正苦于以下问题:PHP eZPackage::fetchPackages方法的具体用法?PHP eZPackage::fetchPackages怎么用?PHP eZPackage::fetchPackages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZPackage
的用法示例。
在下文中一共展示了eZPackage::fetchPackages方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display()
{
// Get site templates from setup.ini
$config = eZINI::instance( 'setup.ini' );
$thumbnailBase = $config->variable( 'SiteTemplates', 'ThumbnailBase' );
$thumbnailExtension = $config->variable( 'SiteTemplates', 'ThumbnailExtension' );
$site_templates = array();
$packages = eZPackage::fetchPackages( array( 'path' => 'kernel/setup/packages' ) );
foreach( $packages as $key => $package )
{
$site_templates[$key]['name'] = $package->attribute( 'summary' );
$site_templates[$key]['identifier'] = $package->attribute( 'name' );
$thumbnails = $package->thumbnailList( 'default' );
if ( count( $thumbnails ) > 0 )
$site_templates[$key]['image_file_name'] = $package->fileItemPath( $thumbnails[0], 'default', 'kernel/setup/packages' );
else
$site_templates[$key]['image_file_name'] = false;
}
$this->Tpl->setVariable( 'site_templates', $site_templates );
$this->Tpl->setVariable( 'error', $this->Error );
// Return template and data to be shown
$result = array();
// Display template
$result['content'] = $this->Tpl->fetch( 'design:setup/init/site_templates.tpl' );
$result['path'] = array( array( 'text' => ezpI18n::tr( 'design/standard/setup/init',
'Site template selection' ),
'url' => false ) );
return $result;
}
示例2: fetchList
function fetchList($filterArray = false, $offset, $limit, $repositoryID)
{
$filterParams = array();
$filterList = false;
if (isset($filterArray) and is_array($filterArray) and count($filterArray) > 0) {
$filterList = $filterArray;
if (count($filterArray) > 1 and !is_array($filterArray[0])) {
$filterList = array($filterArray);
}
}
if ($filterList !== false) {
foreach ($filterList as $filter) {
if (is_array($filter) and count($filter) > 0) {
$filterName = $filter[0];
switch ($filterName) {
case 'type':
$typeValue = $filter[1];
$typeParam = array('type' => $typeValue);
$filterParams = array_merge($filterParams, $typeParam);
break;
case 'priority':
$priorityValue = $filter[1];
$priorityParam = array('priority' => $priorityValue);
$filterParams = array_merge($filterParams, $priorityParam);
break;
case 'vendor':
$vendorValue = $filter[1];
$vendorParam = array('vendor' => $vendorValue);
$filterParams = array_merge($filterParams, $vendorParam);
break;
case 'extension':
$extensionValue = $filter[1];
$extensionParam = array('extension' => $extensionValue);
$filterParams = array_merge($filterParams, $extensionParam);
break;
default:
eZDebug::writeWarning('Unknown package filter name: ' . $filterName);
continue;
}
}
}
}
$params = array('offset' => $offset, 'limit' => $limit);
if ($repositoryID) {
$params['repository_id'] = $repositoryID;
}
$packageList = eZPackage::fetchPackages($params, $filterParams);
if ($packageList === null) {
return array('error' => array('error_type' => 'kernel', 'error_code' => eZError::KERNEL_NOT_FOUND));
}
return array('result' => $packageList);
}
示例3: display
function display()
{
$siteTypes = $this->chosenSiteTypes();
$siteType = $siteTypes[0]['identifier'];
$typeFunctionality = eZSetupFunctionality($siteType);
$requiredPackageList = $typeFunctionality['required'];
$requiredPackages = array();
foreach ($requiredPackageList as $requiredPackage) {
$requiredPackages[] = strtolower($requiredPackage);
}
$packageArray = eZPackage::fetchPackages(array('repository_id' => 'addons'));
$requiredPackageInfoArray = array();
$packageInfoArray = array();
foreach ($packageArray as $package) {
if (in_array(strtolower($package->attribute('name')), $requiredPackages)) {
$requiredPackageInfoArray[] = array('identifier' => $package->attribute('name'), 'name' => $package->attribute('summary'), 'description' => $package->attribute('description'));
} else {
$packageInfoArray[] = array('identifier' => $package->attribute('name'), 'name' => $package->attribute('summary'), 'description' => $package->attribute('description'));
}
}
$recommended = array();
if (isset($typeFunctionality['recommended'])) {
$recommended = $typeFunctionality['recommended'];
}
if (isset($this->PersistenceList['additional_packages'])) {
$recommended = array_unique(array_merge($recommended, $this->PersistenceList['additional_packages']));
}
$this->Tpl->setVariable('site_types', $siteTypes);
$this->Tpl->setVariable('recommended_package_array', $recommended);
$this->Tpl->setVariable('error', $this->ErrorMsg);
$this->Tpl->setVariable('required_package_array', $requiredPackageInfoArray);
$this->Tpl->setVariable('package_array', $packageInfoArray);
// Return template and data to be shown
$result = array();
// Display template
$result['content'] = $this->Tpl->fetch('design:setup/init/site_packages.tpl');
$result['path'] = array(array('text' => ezpI18n::tr('design/standard/setup/init', 'Site functionality'), 'url' => false));
return $result;
}
示例4: availableSitePackages
/**
* @return array
*/
function availableSitePackages()
{
$packageList = eZPackage::fetchPackages(array(), array('type' => 'site'));
return $packageList;
}
示例5: fetchAvailablePackages
/**
* Fetches list of packages already available locally.
*
* \private
*/
function fetchAvailablePackages($type = false)
{
$typeArray = array();
if ($type) {
$typeArray['type'] = $type;
}
$packageList = eZPackage::fetchPackages(array('db_available' => false), $typeArray);
return $packageList;
}
示例6: array
}
$script->setUser($userLogin, $userPassword);
$script->initialize();
$alreadyCreated = false;
$createdPackages = array();
foreach ($commandList as $commandItem) {
$command = $commandItem['command'];
if ($command == 'list') {
$fetchParameters = array();
if ($repositoryID) {
$fetchParameters['repository_id'] = $repositoryID;
$cli->output("The list of packages in the repository " . $cli->stylize('dir', $fetchParameters['repository_id']) . ":");
} else {
$cli->output("The list of all packages:");
}
$packages = eZPackage::fetchPackages($fetchParameters);
if (count($packages) > 0) {
foreach ($packages as $package) {
$packageRepInfo = $package->currentRepositoryInformation();
$cli->output('[' . $packageRepInfo['id'] . '] ' . $package->attribute('name') . ' ver.' . $package->attribute('version-number') . '-' . $package->attribute('release-number') . ' (' . $cli->stylize('emphasize', $package->attribute('summary')) . ')');
}
} else {
$cli->output("No packages are available");
}
} else {
if ($command == 'info') {
if (isset($createdPackages[$commandItem['name']])) {
$package =& $createdPackages[$commandItem['name']];
} else {
$package = eZPackage::fetch($commandItem['name']);
}