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


PHP myContentStorage::dirForId方法代码示例

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


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

示例1: createFilePath

 public static function createFilePath($base_path, $file_name)
 {
     $id = self::getEntryIdFromFileName($file_name);
     // create a new path with the file name
     $entry = entryPeer::retrieveByPK($id);
     if ($entry) {
         KalturaLog::debug("Found entry for file_name [{$file_name}] -> entry_id [{$id}]");
         $int_id = $entry->getIntId();
         $path_name = myContentStorage::dirForId($int_id, $id) . "." . pathinfo($file_name, PATHINFO_EXTENSION);
     } else {
         KalturaLog::debug("Did NOT find entry for file_name [{$file_name}] -> entry_id [{$id}]");
         $path_name = "AZ/" . pathinfo($file_name, PATHINFO_BASENAME);
     }
     // make sure the separator exists between the 2 paths
     //		if ( ! kString::endsWith( $base_path , "/" ) ) $base_path .= "/";
     kFile::fullMkdir($base_path . "/" . $path_name);
     return $base_path . "/" . $path_name;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:18,代码来源:kConversionClientBase.class.php

示例2: getFeedByEntryIdAction

 /**
  * @action getFeedByEntryId
  * @disableTags TAG_WIDGET_SESSION,TAG_ENTITLEMENT_ENTRY,TAG_ENTITLEMENT_CATEGORY
  * @param int $distributionProfileId
  * @param string $hash
  * @param string $entryId
  * @return file
  */
 public function getFeedByEntryIdAction($distributionProfileId, $hash, $entryId)
 {
     if (!$this->getPartnerId() || !$this->getPartner()) {
         throw new KalturaAPIException(KalturaErrors::INVALID_PARTNER_ID, $this->getPartnerId());
     }
     $profile = DistributionProfilePeer::retrieveByPK($distributionProfileId);
     if (!$profile || !$profile instanceof DoubleClickDistributionProfile) {
         throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_NOT_FOUND, $distributionProfileId);
     }
     if ($profile->getStatus() != KalturaDistributionProfileStatus::ENABLED) {
         throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_DISABLED, $distributionProfileId);
     }
     if ($profile->getUniqueHashForFeedUrl() != $hash) {
         throw new KalturaAPIException(DoubleClickDistributionErrors::INVALID_FEED_URL);
     }
     // Creates entry filter with advanced filter
     $entry = entryPeer::retrieveByPK($entryId);
     if (!$entry || $entry->getPartnerId() != $this->getPartnerId()) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
     }
     // Construct the feed
     $feed = new DoubleClickFeed('doubleclick_template.xml', $profile);
     $feed->setTotalResult(1);
     $feed->setStartIndex(1);
     $profileUpdatedAt = $profile->getUpdatedAt(null);
     $cacheDir = kConf::get("global_cache_dir") . "feeds/dist_{$distributionProfileId}/";
     // check cache
     $cacheFileName = $cacheDir . myContentStorage::dirForId($entry->getIntId(), $entry->getId() . ".xml");
     $updatedAt = max($profileUpdatedAt, $entry->getUpdatedAt(null));
     if (file_exists($cacheFileName) && $updatedAt < filemtime($cacheFileName)) {
         $xml = file_get_contents($cacheFileName);
     } else {
         $entryDistribution = EntryDistributionPeer::retrieveByEntryAndProfileId($entry->getId(), $profile->getId());
         if (!$entryDistribution) {
             throw new KalturaAPIException(ContentDistributionErrors::ENTRY_DISTRIBUTION_NOT_FOUND, '');
         }
         $fields = $profile->getAllFieldValues($entryDistribution);
         $flavorAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getFlavorAssetIds()));
         $thumbAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getThumbAssetIds()));
         $cuePoints = $this->getCuePoints($entry->getPartnerId(), $entry->getId());
         $xml = $feed->getItemXml($fields, $flavorAssets, $thumbAssets, $cuePoints);
         mkdir(dirname($cacheFileName), 0777, true);
         file_put_contents($cacheFileName, $xml);
     }
     $feed->addItemXml($xml);
     header('Content-Type: text/xml');
     echo $feed->getXml();
     die;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:57,代码来源:DoubleClickService.php


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