PHPackages                             dknx01/rsl-lib - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. dknx01/rsl-lib

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dknx01/rsl-lib
==============

RSL generation lib

0.2(6mo ago)00MITPHPPHP &gt;=8.4

Since Dec 17Pushed 6mo agoCompare

[ Source](https://github.com/dknx01/rsl-lib-php)[ Packagist](https://packagist.org/packages/dknx01/rsl-lib)[ RSS](/packages/dknx01-rsl-lib/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

rsl-lib-php
===========

[](#rsl-lib-php)

This is a library for creating an XML string of the RSL standard to be used in your application. It has only dependencies for testing purpose and for PHP (DOM extension).

### RSL = Really Simple Licensing

[](#rsl--really-simple-licensing)

The open content licensing standard for the AI-first Internet

RSL is an open, XML-based document format for defining machine-readable licensing terms for digital assets, including web pages, books, videos, images, and proprietary datasets.

Website:

Installation:
-------------

[](#installation)

```
composer require dknx01/rsl-lib
```

Usage
-----

[](#usage)

You can have a look into the `test/Integration/RslBuilderTest` class. The result is like the test example under `tests/Integration/expected.xml`.

This is an example with all fields filled:

```
$builder = new RslBuilder();
        $content = new Content('/', 'https://api.example.com');
        $content->addLicense(
            new License(
                permits: [
                    Usage::new(UsageAssets::ALL),
                    User::new(UserAssets::EDUCATION),
                    Geo::new(['EU']),
                ],
                prohibits: [
                    \Dknx01\RslLib\Elements\Probihits\User::new(UserAssets::EDUCATION),
                    \Dknx01\RslLib\Elements\Probihits\Usage::new(UsageAssets::AI_INPUT),
                    \Dknx01\RslLib\Elements\Probihits\Geo::new(['AF']),
                ],
                payments: [
                    PurchasePayment::new([
                        new Amount('EUR', '49.00'),
                        new Accepts('{"json": true}'),
                        new Standard('https://creativecommons.org/licenses/by/4.0/'),
                        new Custom('https://creativecommons.org/licenses/by/4.0/'),
                    ]),
                    SubscriptionPayment::new([new Amount('EUR', '49.00')]),
                    TrainingPayment::new([new Amount('EUR', '49.00')]),
                    CrawlPayment::new([new Amount('EUR', '49.00'), new Accepts('{"json": true}')]),
                    UsePayment::new([new Amount('EUR', '49.00')]),
                    ContributionPayment::new([new Amount('EUR', '49.00')]),
                    AttributionPayment::new([new Amount('EUR', '49.00')]),
                    FreePayment::new([new Amount('EUR', '0.00')]),
                ],
                legals: [
                    Warranty::new('ownership authority no-infringement'),
                    Disclaimer::new('as-is no-liability'),
                    Attestation::new(true),
                    Contact::new('https://example.com/contact'),
                    Proof::new('https://blockscan.example/tx/0x9aBcD123... '),
                ]
            )
        )
            ->addAlternate(new Alternate('/exports/site-2025-10-20.warc', 'application/warc'))
            ->addAlternate(new Alternate('/exports/site-2025-10-20.json', 'application/json'))
            ->addSchema(new Schema(value: '/metadata/books/moby-dick.jsonld'))
            ->addCopyright(new Copyright(value: 'Example Media LLC', type: 'organization', contactUrl: 'https://example.com/contact.html'))
            ->addTerms(new Terms('https://example.com/legal/data-terms.html'));

        $builder->addContent($content);
        $result = $builder->getXml();
```

TO see which parameters are available and needed, have a look on the RSL website. The naming is the same for the elements.

For example: `addCopyright(new Copyright(value: 'Example Media LLC', type: 'organization', contactUrl: 'https://example.com/contact.html'))` is not needed if you don't provide this information

ToDo
----

[](#todo)

\[\] improve test coverage \[\] add more examples

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance66

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

199d ago

### Community

Maintainers

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

---

Top Contributors

[![dknx01](https://avatars.githubusercontent.com/u/3475199?v=4)](https://github.com/dknx01 "dknx01 (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dknx01-rsl-lib/health.svg)

```
[![Health](https://phpackages.com/badges/dknx01-rsl-lib/health.svg)](https://phpackages.com/packages/dknx01-rsl-lib)
```

PHPackages © 2026

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