PHPackages                             dansup/php-activitystreams - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. dansup/php-activitystreams

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

dansup/php-activitystreams
==========================

Activity Streams is a simple specification used to describe social actions around the web. http://activitystrea.ms

0.0.2(9y ago)17232MITPHPPHP ~5.5|~7.0

Since Apr 20Pushed 8y ago2 watchersCompare

[ Source](https://github.com/dansup/php-activitystreams)[ Packagist](https://packagist.org/packages/dansup/php-activitystreams)[ Docs](https://github.com/dansup/php-activitystreams)[ RSS](/packages/dansup-php-activitystreams/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

php-activitystreams
===================

[](#php-activitystreams)

> A PHP implementation of the Activity Streams 2.0 specification

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Latest Version on Packagist](https://camo.githubusercontent.com/97e92f26068ad60a3f17e530fc62d9bf77df4d9f79dd3ae045917af953905207/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64616e7375702f7068702d616374697669747973747265616d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dansup/php-activitystreams)[![Total Downloads](https://camo.githubusercontent.com/799739403a48d43d70827c424fffc0cb6d7b182a10f4762ebf2349e13c69a8d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64616e7375702f7068702d616374697669747973747265616d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dansup/php-activitystreams)

**This package is in active development, this is not a complete implementation of ActivityStreams 2.0**

A modern AS2 php library. At the moment, only the [object model type](https://www.w3.org/TR/activitystreams-core/#object) is partially implemented. I look forward to getting this feature complete by the end of summer 2017.

Install
-------

[](#install)

Via Composer

```
$ composer require dansup/php-activitystreams
```

Usage
-----

[](#usage)

> Lets create a [basic object model](https://www.w3.org/TR/activitystreams-core/#object) and echo the response to a json encoded string.

```
use Dansup\ActivityStreams\ServerFactory;

$item = ServerFactory::create('object');

$item->type('Note')
$item->id('http://example.org/note/123');
$item->name('Our Weather Is Fine');
$item->content('I feel that the weather is appropriate to our season and location.');
$item->attributedTo([
  'id' => 'http://joe.website.example/',
  'type' => 'Person',
  'name' => 'Joe Smith'
]);
$item->addField('url', 'http://example.org/permalink/123');

echo $item->get();
```

### Result:

[](#result)

```
{
 "@context": "https:\/\/www.w3.org\/ns\/activitystreams",
 "type": "Note",
 "id": "http:\/\/example.org\/note\/123",
 "name": "Our Weather Is Fine",
 "attributedTo": {
     "id": "http:\/\/joe.website.example\/",
     "type": "Person",
     "name": "Joe Smith"
 },
 "content": "I feel that the weather is appropriate to our season and location.",
 "published": "2017-04-21T01:31:20+00:00",
 "url": "http:\/\/example.org\/permalink\/123"
}
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Daniel Supernault](https://github.com/dansup)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3358d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b6f279a69b741c13c678663a9780d178bd9432c63b53b155e8e751dc560ddcca?d=identicon)[dansup](/maintainers/dansup)

---

Top Contributors

[![dansup](https://avatars.githubusercontent.com/u/877217?v=4)](https://github.com/dansup "dansup (20 commits)")

---

Tags

activity-streamsactivitystreamsindiewebphpphp-activitystreamsjsonFederationactivitystreamsas2indiewebactivity-streamsdansup

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/dansup-php-activitystreams/health.svg)

```
[![Health](https://phpackages.com/badges/dansup-php-activitystreams/health.svg)](https://phpackages.com/packages/dansup-php-activitystreams)
```

###  Alternatives

[justinrainbow/json-schema

A library to validate a json schema.

3.6k328.4M753](/packages/justinrainbow-json-schema)[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k493.5M162](/packages/mtdowling-jmespathphp)[spatie/laravel-sitemap

Create and generate sitemaps with ease

2.6k16.6M140](/packages/spatie-laravel-sitemap)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k141.9M908](/packages/jms-serializer)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k91.4M667](/packages/jms-serializer-bundle)[colinodell/json5

UTF-8 compatible JSON5 parser for PHP

30525.1M52](/packages/colinodell-json5)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
