PluginProbe
ActivityPub / 5.9.0
ActivityPub v5.9.0
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
activitypub / includes / activity / class-actor.php

class-actor.php in ActivityPub 5.9.0, at includes/activity/class-actor.php

225 lines 5.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Inspired by the PHP ActivityPub Library by @Landrok
4 *
5 * @link https://github.com/landrok/activitypub
6 *
7 * @package Activitypub
8 */
9
10 namespace Activitypub\Activity;
11
12 /**
13 * \Activitypub\Activity\Actor is an implementation of
14 * one an Activity Streams Actor.
15 *
16 * Represents an individual actor.
17 *
18 * @see https://www.w3.org/TR/activitystreams-vocabulary/#actor-types
19 */
20 class Actor extends Base_Object {
21 // Reduced context for actors. TODO: still unused.
22 const JSON_LD_CONTEXT = array(
23 'https://www.w3.org/ns/activitystreams',
24 'https://w3id.org/security/v1',
25 'https://purl.archive.org/socialweb/webfinger',
26 array(
27 'schema' => 'http://schema.org#',
28 'toot' => 'http://joinmastodon.org/ns#',
29 'lemmy' => 'https://join-lemmy.org/ns#',
30 'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers',
31 'PropertyValue' => 'schema:PropertyValue',
32 'value' => 'schema:value',
33 'Hashtag' => 'as:Hashtag',
34 'featured' => array(
35 '@id' => 'toot:featured',
36 '@type' => '@id',
37 ),
38 'featuredTags' => array(
39 '@id' => 'toot:featuredTags',
40 '@type' => '@id',
41 ),
42 'moderators' => array(
43 '@id' => 'lemmy:moderators',
44 '@type' => '@id',
45 ),
46 'alsoKnownAs' => array(
47 '@id' => 'as:alsoKnownAs',
48 '@type' => '@id',
49 ),
50 'movedTo' => array(
51 '@id' => 'as:movedTo',
52 '@type' => '@id',
53 ),
54 'attributionDomains' => array(
55 '@id' => 'toot:attributionDomains',
56 '@type' => '@id',
57 ),
58 'postingRestrictedToMods' => 'lemmy:postingRestrictedToMods',
59 'discoverable' => 'toot:discoverable',
60 'indexable' => 'toot:indexable',
61 ),
62 );
63
64 /**
65 * The default types for Actors.
66 *
67 * @see https://www.w3.org/TR/activitystreams-vocabulary/#actor-types
68 *
69 * @var array
70 */
71 const TYPES = array(
72 'Application',
73 'Group',
74 'Organization',
75 'Person',
76 'Service',
77 );
78
79 /**
80 * The type of the object.
81 *
82 * @var string
83 */
84 protected $type;
85
86 /**
87 * A reference to an ActivityStreams OrderedCollection comprised of
88 * all the messages received by the actor.
89 *
90 * @see https://www.w3.org/TR/activitypub/#inbox
91 *
92 * @var string|null
93 */
94 protected $inbox;
95
96 /**
97 * A reference to an ActivityStreams OrderedCollection comprised of
98 * all the messages produced by the actor.
99 *
100 * @see https://www.w3.org/TR/activitypub/#outbox
101 *
102 * @var string|null
103 */
104 protected $outbox;
105
106 /**
107 * A link to an ActivityStreams collection of the actors that this
108 * actor is following.
109 *
110 * @see https://www.w3.org/TR/activitypub/#following
111 *
112 * @var string
113 */
114 protected $following;
115
116 /**
117 * A link to an ActivityStreams collection of the actors that
118 * follow this actor.
119 *
120 * @see https://www.w3.org/TR/activitypub/#followers
121 *
122 * @var string
123 */
124 protected $followers;
125
126 /**
127 * A link to an ActivityStreams collection of objects this actor has
128 * liked.
129 *
130 * @see https://www.w3.org/TR/activitypub/#liked
131 *
132 * @var string
133 */
134 protected $liked;
135
136 /**
137 * A list of supplementary Collections which may be of interest.
138 *
139 * @see https://www.w3.org/TR/activitypub/#streams-property
140 *
141 * @var array
142 */
143 protected $streams = array();
144
145 /**
146 * A short username which may be used to refer to the actor, with no
147 * uniqueness guarantees.
148 *
149 * @see https://www.w3.org/TR/activitypub/#preferredUsername
150 *
151 * @var string|null
152 */
153 protected $preferred_username;
154
155 /**
156 * A JSON object which maps additional typically server/domain-wide
157 * endpoints which may be useful either for this actor or someone
158 * referencing this actor. This mapping may be nested inside the
159 * actor document as the value or may be a link to a JSON-LD
160 * document with these properties.
161 *
162 * @see https://www.w3.org/TR/activitypub/#endpoints
163 *
164 * @var string|array|null
165 */
166 protected $endpoints;
167
168 /**
169 * It's not part of the ActivityPub protocol, but it's a quite common
170 * practice to handle an actor public key with a publicKey array:
171 * [
172 * 'id' => 'https://my-example.com/actor#main-key'
173 * 'owner' => 'https://my-example.com/actor',
174 * 'publicKeyPem' => '-----BEGIN PUBLIC KEY-----
175 * [...]
176 * -----END PUBLIC KEY-----'
177 * ]
178 *
179 * @see https://www.w3.org/wiki/SocialCG/ActivityPub/Authentication_Authorization#Signing_requests_using_HTTP_Signatures
180 *
181 * @var string|array|null
182 */
183 protected $public_key;
184
185 /**
186 * It's not part of the ActivityPub protocol, but it's a quite common
187 * practice to lock an account. If enabled, new followers will not be
188 * automatically accepted, but will instead require you to manually
189 * approve them.
190 *
191 * WordPress does only support 'false' at the moment.
192 *
193 * @see https://docs.joinmastodon.org/spec/activitypub/#as
194 *
195 * @context as:manuallyApprovesFollowers
196 *
197 * @var boolean
198 */
199 protected $manually_approves_followers = false;
200
201 /**
202 * Domains allowed to use `fediverse:creator` for this actor in
203 * published articles.
204 *
205 * @see https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/
206 *
207 * @var array
208 */
209 protected $attribution_domains = null;
210
211 /**
212 * The target of the actor.
213 *
214 * @var string|null
215 */
216 protected $moved_to;
217
218 /**
219 * The alsoKnownAs of the actor.
220 *
221 * @var array
222 */
223 protected $also_known_as;
224 }
225