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


PHP Ostatus_profile::checkAuthorship方法代码示例

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


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

示例1: onStartHandleFeedEntryWithProfile

 /**
  * Handle a posted object from PuSH
  *
  * @param Activity        $activity activity to handle
  * @param Ostatus_profile $oprofile Profile for the feed
  *
  * @return boolean hook value
  */
 function onStartHandleFeedEntryWithProfile($activity, $oprofile, &$notice)
 {
     if ($this->isMyActivity($activity)) {
         $actor = $oprofile->checkAuthorship($activity);
         if (empty($actor)) {
             // TRANS: Client exception thrown when no author for an activity was found.
             throw new ClientException(_('Cannot get author for activity.'));
         }
         $object = $activity->objects[0];
         $options = array('uri' => $object->id, 'url' => $object->link, 'is_local' => Notice::REMOTE, 'source' => 'ostatus');
         // $actor is an ostatus_profile
         $notice = $this->saveNoticeFromActivity($activity, $actor->localProfile(), $options);
         return false;
     }
     return true;
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:24,代码来源:microappplugin.php

示例2: onStartHandleFeedEntryWithProfile

 /**
  * Handle a posted bookmark from PuSH
  *
  * @param Activity        $activity activity to handle
  * @param Ostatus_profile $oprofile Profile for the feed
  *
  * @return boolean hook value
  */
 function onStartHandleFeedEntryWithProfile($activity, $oprofile)
 {
     common_log(LOG_INFO, "BookmarkPlugin called for new feed entry.");
     if (self::_isPostBookmark($activity)) {
         common_log(LOG_INFO, "Importing activity {$activity->id} as a bookmark.");
         $author = $oprofile->checkAuthorship($activity);
         if (empty($author)) {
             throw new ClientException(_('Can\'t get author for activity.'));
         }
         self::_postRemoteBookmark($author, $activity);
         return false;
     }
     return true;
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:22,代码来源:BookmarkPlugin.php


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