chili-labs / json-pointer
Simple library for accessing PHP data structures with JSON Pointers (RFC 6901)
Installs: 3 191
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: >=5.3.3
Requires (Dev)
- symfony/property-access: ~2.3
Suggests
- symfony/property-access: Required when using the PropertyAccessAccessor
This package is not auto-updated.
Last update: 2019-08-20 21:52:04 UTC
README
Simple library for accessing PHP data structures with JSON Pointers (RFC 6901)
Description
This library implements the RFC 6901 for PHP. It is possible to
parse a path (e.g./some/path
) or create the JsonPointer
object from array (e.g. ['some','path']
).
There are several other good libraries (
1,
2,
3
) for parsing json-pointers, but none of
them was able to access other php structures besides default arrays. With different accessors, which are part of this
library, you can apply json-pointers to either arrays or also plain objects. Custom accessors can simply be created
on your own.
Installation
To install this library, run the command below and you will get the latest version:
composer require chili-labs/json-pointer
Usage
The documentation is work in progress.
Tests
To run the test suite, you need composer.
composer install
phpunit
License
JSONPointer is licensed under the MIT license.