togos / php-n2r
Library (and stand-alone scripts) for handling /uri-res/N2R requests backed by a ccouch repository.
Installs: 13 808
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.2
- ryprop/nife: ^0.2.5
- togos/base32: ^1.0.1
- togos/simpler-test: ^1.1
Requires (Dev)
- togos/xml-rdf-parser: 2.1.0
README
Serves blobs identified by urn:sha1 and urn:bitprint URNs via the /uri-res/N2R?(URN) convention (see RFC 2169).
Can be used as a library or by itself.
Installation as stand-alone script
- Check this project out to a directory under your document root called 'uri-res'.
- Copy config.php.example to config.php and edit it.
- That's it.
ext-lib contains classes from other libraries so that you don't need to ``composer install``` to use PHPN2R by itself.
Repository format
See ContentCouchRepositoryFormat.
The repositories listed in config.php are assumed to be of the following format
<repository directory>/
data/
<arbitrary sector name>/
<first 2 letters of base32-encoded SHA-1>/
<base32-encoded SHA-1 of file contents>
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
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:
Look at http://pablotron.org/software/zipstream-php/ for making zips of directories