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


PHP eZPackage::definitionFilename方法代码示例

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


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

示例1: fetchPackages

 static function fetchPackages($parameters = array(), $filterArray = array())
 {
     $packageRepositories = eZPackage::packageRepositories($parameters);
     $packages = array();
     $requiredType = null;
     $requiredPriority = null;
     $requiredVendor = null;
     $requiredExtension = null;
     if (isset($filterArray['type'])) {
         $requiredType = $filterArray['type'];
     }
     if (isset($filterArray['priority'])) {
         $requiredPriority = $filterArray['priority'];
     }
     if (isset($filterArray['vendor'])) {
         $requiredVendor = $filterArray['vendor'];
     }
     if (isset($filterArray['extension'])) {
         $requiredExtension = $filterArray['extension'];
     }
     $repositoryID = false;
     if (isset($parameters['repository_id'])) {
         $repositoryID = $parameters['repository_id'];
     }
     $dbAvailable = true;
     if (isset($parameters['db_available'])) {
         $dbAvailable = $parameters['db_available'];
     }
     foreach ($packageRepositories as $packageRepository) {
         if (strlen($repositoryID) == 0 or $repositoryID == $packageRepository['id']) {
             $path = $packageRepository['path'];
             if (file_exists($path)) {
                 $fileList = array();
                 $dir = opendir($path);
                 while (($file = readdir($dir)) !== false) {
                     if ($file == '.' or $file == '..') {
                         continue;
                     }
                     $fileList[] = $file;
                 }
                 closedir($dir);
                 sort($fileList);
                 foreach ($fileList as $file) {
                     $dirPath = $path . '/' . $file;
                     if (!is_dir($dirPath)) {
                         continue;
                     }
                     $filePath = $dirPath . '/' . eZPackage::definitionFilename();
                     if (file_exists($filePath)) {
                         $fileModification = filemtime($filePath);
                         $name = $file;
                         $packageCachePath = $dirPath . '/' . eZPackage::cacheDirectory() . '/package.php';
                         unset($package);
                         $package = false;
                         $cacheExpired = false;
                         if (eZPackage::useCache()) {
                             $package = eZPackage::fetchFromCache($dirPath, $fileModification, $cacheExpired);
                         }
                         if (!$package) {
                             $package = eZPackage::fetchFromFile($filePath);
                             if ($package and $cacheExpired and eZPackage::useCache()) {
                                 $package->storeCache($dirPath . '/' . eZPackage::cacheDirectory());
                             }
                         }
                         if (!$package) {
                             continue;
                         }
                         if ($dbAvailable) {
                             $package->getInstallState();
                         }
                         if ($requiredType !== null) {
                             $type = $package->attribute('type');
                             if ($type != $requiredType) {
                                 continue;
                             }
                         }
                         if ($requiredPriority !== null) {
                             $priority = $package->attribute('priority');
                             if ($priority != $requiredPriority) {
                                 continue;
                             }
                         }
                         if ($requiredExtension !== null) {
                             $extension = $package->attribute('extension');
                             if ($extension != $requiredExtension) {
                                 continue;
                             }
                         }
                         if ($requiredVendor !== null) {
                             $vendor = $package->attribute('vendor');
                             if ($vendor != $requiredVendor) {
                                 continue;
                             }
                         }
                         $package->setCurrentRepositoryInformation($packageRepository);
                         $packages[] =& $package;
                     }
                 }
             }
         }
//.........这里部分代码省略.........
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:101,代码来源:ezpackage.php


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