PHPackages                             togos/php-n2r - 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. togos/php-n2r

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

togos/php-n2r
=============

Library (and stand-alone scripts) for handling /uri-res/N2R requests backed by a ccouch repository.

0.1.16(4mo ago)014.1k13MITPHPPHP &gt;=5.2

Since Sep 10Pushed 4mo agoCompare

[ Source](https://github.com/TOGoS/PHPN2R)[ Packagist](https://packagist.org/packages/togos/php-n2r)[ RSS](/packages/togos-php-n2r/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (31)Used By (3)

PHPN2R
======

[](#phpn2r)

Serves blobs identified by urn:sha1 and urn:bitprint URNs via the `/uri-res/N2R?`+(URN) convention (see [RFC 2169](https://www.ietf.org/rfc/rfc2169.txt)).

Can be used as a library or by itself.

Installation as stand-alone script
----------------------------------

[](#installation-as-stand-alone-script)

1. Check this project out to a directory under your document root called `uri-res`.
2. If you feel like it, run `composer install`
3. Copy config.php.example to config.php and edit it.
4. Serve using your favorite web server (or `php -S localhost:1234 dispatch.php`)

If `vendor/autoload.php` does not exist (because you did not run `composer install`), scripts will fall back to loading the included versions of the libraries from `ext-lib`. This way PHPN2R can continue to run on old computers with very old versions of PHP and composer isntalled, like that raspberry Pi 2B under the stairs that's been running the same old Raspbian since 2012.

### Repository format

[](#repository-format)

See [ContentCouchRepositoryFormat](//github.com/TOGoS/ContentCouchRepositoryFormat).

The repositories listed in config.php are assumed to be of the following format

```
  /
    data/
      /
        /

```

You can have any number of sectors, and their names are not important. They just act as buckets within which you can organize your data (e.g. you might put really important stuff in one, less important stuff somewhere else, data of questionable value in yet another).

Use as a library
----------------

[](#use-as-a-library)

Explicitly not documented, because the API isn't so nice and I'm probably the only one in the world to whom it is useful, anyway.

TODO:
-----

[](#todo)

Look at  for making zips of directories

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance74

Regular maintenance activity

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

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

Recently: every ~710 days

Total

29

Last Release

140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/84f2846fb867825e6831a99f7ba5ca9301de56a424928e2c494f81c2c6061677?d=identicon)[TOGoS](/maintainers/TOGoS)

---

Top Contributors

[![TOGoS](https://avatars.githubusercontent.com/u/57142?v=4)](https://github.com/TOGoS "TOGoS (109 commits)")

### Embed Badge

![Health badge](/badges/togos-php-n2r/health.svg)

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

###  Alternatives

[t3docs/examples

This extension packages a number of code examples from the Core Documentation.

3120.2k](/packages/t3docs-examples)

PHPackages © 2026

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