ActivityContext.php

Summary
ActivityContext.php
ActivityContextClass abstraction for Activity verb contexts
ActivityContext
__constructClass constructor
getLocationParse location given as a GeoRSS-simple point, if provided.
locationFromPointXXX: Move to ActivityUtils or Location?
asArrayReturns context (StatusNet stuff) as an array suitable for serializing in JSON.
getToArrayReturns an array of arrays representing Activity Objects (intended to be serialized in JSON) that represent WHO the Activity is supposed to be received by.
getInReplyToArrayReturn an array for the notices this notice is a reply to suitable for serializing as JSON note objects.

ActivityContext

Class abstraction for Activity verb contexts

postActiv

the micro-blogging software

Copyright

Copyright © 2016-2017, Maiyannah Bishop

Derived from code copyright various sources

  • GNU Social © 2013-2016, Free Software Foundation, Inc
  • StatusNet © 2008-2012, StatusNet, Inc

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses/.

https://www.gnu.org/licenses/agpl.html

About

An activity verb in class form, and the related scaffolding.

This file also now consolidates the ActivityContext, ActivityImporter, ActivityMover, ActivitySink, and ActivitySource classes, formerly at /lib/<class>.php

  • Activity abstracts the class for an activity verb.
  • ActivityContext contains information of the context of the activity verb.
  • ActivityImporter abstracts a means that is importing activity verbs into the system as part of a user’s timeline.
  • ActivityMover abstracts the means to transport activity verbs.
  • ActivitySink abstracts a class to receive activity verbs.
  • ActivitySource abstracts a class to represent the source of a received activity verb.

ActivityObject is a noun in the activity universe basically, from the original file: A noun-ish thing in the activity universe

The activity streams spec talks about activity objects, while also having a tag activity:object, which is in fact an activity object.  Aaaaaah!

This is just a thing in the activity universe.  Can be the subject, object, or indirect object (target!) of an activity verb.  Rotten name, and I’m propagating it.  sigh It’s large enough that I’ve left it seperate in activityobject.php

PHP version

Tested with PHP 5.6

File Authors

Web

ActivityContext

Summary
__constructClass constructor
getLocationParse location given as a GeoRSS-simple point, if provided.
locationFromPointXXX: Move to ActivityUtils or Location?
asArrayReturns context (StatusNet stuff) as an array suitable for serializing in JSON.
getToArrayReturns an array of arrays representing Activity Objects (intended to be serialized in JSON) that represent WHO the Activity is supposed to be received by.
getInReplyToArrayReturn an array for the notices this notice is a reply to suitable for serializing as JSON note objects.

__construct

function __construct($element =  null)

Class constructor

getLocation

function getLocation($dom)

Parse location given as a GeoRSS-simple point, if provided.  http://www.georss.org/simple

Parameters

  • feed item $entry

Returns

  • mixed Location or false

locationFromPoint

static function locationFromPoint($point)

XXX: Move to ActivityUtils or Location?

Parameters

  • point

asArray

function asArray()

Returns context (StatusNet stuff) as an array suitable for serializing in JSON.  Right now context stuff is an extension to Activity.

Returns

  • array the context

getToArray

function getToArray()

Returns an array of arrays representing Activity Objects (intended to be serialized in JSON) that represent WHO the Activity is supposed to be received by.  This is not really specified but appears in an example of the current spec as an extension.  We might want to figure out a JSON serialization for OStatus and use that to express mentions instead.

XXX: People’s ideas on how to do this are all over the place

Returns

  • array the array of recipients

getInReplyToArray

function getInReplyToArray()

Return an array for the notices this notice is a reply to suitable for serializing as JSON note objects.

Returns

  • array the array of notes
function __construct($element =  null)
Class constructor
function getLocation($dom)
Parse location given as a GeoRSS-simple point, if provided.
static function locationFromPoint($point)
XXX: Move to ActivityUtils or Location?
function asArray()
Returns context (StatusNet stuff) as an array suitable for serializing in JSON.
function getToArray()
Returns an array of arrays representing Activity Objects (intended to be serialized in JSON) that represent WHO the Activity is supposed to be received by.
function getInReplyToArray()
Return an array for the notices this notice is a reply to suitable for serializing as JSON note objects.