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


PHP eZPackage::fetchPackages方法代码示例

本文整理汇总了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;

    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:34,代码来源:ezstep_site_templates.php

示例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);
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:52,代码来源:ezpackagefunctioncollection.php

示例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;
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:39,代码来源:ezstep_site_packages.php

示例4: availableSitePackages

 /**
  * @return array
  */
 function availableSitePackages()
 {
     $packageList = eZPackage::fetchPackages(array(), array('type' => 'site'));
     return $packageList;
 }
开发者ID:netbliss,项目名称:ezpublish,代码行数:8,代码来源:ezstep_installer.php

示例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;
 }
开发者ID:nlenardou,项目名称:ezpublish,代码行数:14,代码来源:ezstep_site_types.php

示例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']);
            }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:31,代码来源:ezpm.php


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