PHPackages                             mekras/atompub - 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. [API Development](/categories/api)
4. /
5. mekras/atompub

ActiveLibrary[API Development](/categories/api)

mekras/atompub
==============

Atom Publishing Protocol support library

v1.0.0(9y ago)110.9k↓67.9%1MITPHPPHP &gt;=5.6

Since Jul 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mekras/atompub)[ Packagist](https://packagist.org/packages/mekras/atompub)[ RSS](/packages/mekras-atompub/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (7)Used By (1)

[Atom Publishing Protocol](http://tools.ietf.org/html/rfc5023) support library
==============================================================================

[](#atom-publishing-protocol-support-library)

[![Latest Stable Version](https://camo.githubusercontent.com/25d156d8894eafa48d4d780705a69c3c568417a253a15a96a0af7667a6284375/68747470733a2f2f706f7365722e707567782e6f72672f6d656b7261732f61746f6d7075622f762f737461626c652e706e67)](https://packagist.org/packages/mekras/atompub)[![License](https://camo.githubusercontent.com/857061f1db08b039c04c75d5d01ef8e39b1d8c9c309f7b26ea491e7bdfabf9ab/68747470733a2f2f706f7365722e707567782e6f72672f6d656b7261732f61746f6d7075622f6c6963656e73652e706e67)](https://packagist.org/packages/mekras/atompub)[![Build Status](https://camo.githubusercontent.com/b7949f5cbafa077cd7c1ff9f728a9b1632ccf0a5bdb535ed2a99700fc28fbef1/68747470733a2f2f7472617669732d63692e6f72672f6d656b7261732f61746f6d7075622e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mekras/atompub)[![Coverage Status](https://camo.githubusercontent.com/804019281ad9c9193bb4a608e532a4f2e4bda543d9e63a970a9902086e29c84d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d656b7261732f61746f6d7075622f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/mekras/atompub?branch=master)

Purpose
-------

[](#purpose)

This library is designed to work with the [AtomPub](http://tools.ietf.org/html/rfc5023) documents in an object-oriented style. It does not contain the functionality to download or display documents.

This library is an extension of the package [Atom](https://packagist.org/packages/mekras/atom).

Parsing documents
-----------------

[](#parsing-documents)

```
use Mekras\Atom\Document\EntryDocument;
use Mekras\Atom\Document\FeedDocument;
use Mekras\Atom\Exception\AtomException;
use Mekras\AtomPub\Document\CategoryDocument;
use Mekras\AtomPub\Document\ServiceDocument;
use Mekras\AtomPub\DocumentFactory;

$factory = new DocumentFactory;

$xml = file_get_contents('http://example.com/atom');
try {
    $document = $factory->parseXML($xml);
} catch (AtomException $e) {
    die($e->getMessage());
}

if ($document instanceof CategoryDocument) {
    $categories = $document->getCategories();
    //...
} elseif ($document instanceof ServiceDocument) {
    $workspaces = $document->getWorkspaces();
    //...
} elseif ($document instanceof FeedDocument) {
    $feed = $document->getFeed();
    //...
} elseif ($document instanceof EntryDocument) {
    $entry = $document->getEntry();
    //...
}
```

Creating entries
----------------

[](#creating-entries)

```
use Mekras\AtomPub\DocumentFactory;

$factory = new DocumentFactory;
$document = $factory->createDocument('atom:entry');
$entry = $document->getEntry();
$entry->addId('urn:entry:0001');
$entry->addTitle('Entry Title');
$entry->addAuthor('Author 1')->setEmail('foo@example.com');
$entry->addContent('Entry content', 'html');
$entry->addCategory('tag1')->setLabel('Tag label')->setScheme('http://example.com/scheme');
$entry->addUpdated(new \DateTime());

// Suppose that $httpClient is some kind of HTTP client...
$httpClient->sendRequest('POST', 'http://example.com/', (string) $document);
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~8 days

Total

6

Last Release

3607d ago

Major Versions

v0.2.0 → v1.0.0-alpha2016-07-13

### Community

Maintainers

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

---

Top Contributors

[![mekras](https://avatars.githubusercontent.com/u/192067?v=4)](https://github.com/mekras "mekras (26 commits)")

---

Tags

atomatompub

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mekras-atompub/health.svg)

```
[![Health](https://phpackages.com/badges/mekras-atompub/health.svg)](https://phpackages.com/packages/mekras-atompub)
```

###  Alternatives

[laminas/laminas-feed

provides functionality for creating and consuming RSS and Atom feeds

16751.3M62](/packages/laminas-laminas-feed)[mibe/feedwriter

Generate feeds in either RSS 1.0, RSS 2.0 or ATOM formats

1951.1M5](/packages/mibe-feedwriter)[debril/rss-atom-bundle

RSS / Atom and JSONFeed support for Symfony

1401.3M2](/packages/debril-rss-atom-bundle)[kiwilan/php-opds

PHP package to create OPDS feed for eBooks.

115.6k3](/packages/kiwilan-php-opds)[dotzecker/larafeed

Feed (Atom and RSS) generator for any framework

111.1k1](/packages/dotzecker-larafeed)

PHPackages © 2026

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