Download the PHP package mikemccabe/json-patch-php without Composer

On this page you can find all versions of the php package mikemccabe/json-patch-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package json-patch-php

json-patch-php

Produce and apply json-patch objects.

Implements IETF JSON-patch (RFC 6902) and JSON-pointer (RFC 6901):

http://tools.ietf.org/html/rfc6902 http://tools.ietf.org/html/rfc6901

Using with Composer

To use this library as a Composer dependency in your project, include the following sections in your project's composer.json file:

Then, in your project's code, use the JsonPatch class definition from the mikemccabe\JsonPatch namespace like so:

Entry points

Arguments are PHP arrays, i.e. the output of json_decode($json_string, 1)

(Note that you MUST pass 1 as the second argument to json_decode to get an array. This library does not work with stdClass objects.)

All structures are implemented directly as PHP arrays. An array is considered to be 'associative' (e.g. like a JSON 'object') if it contains at least one non-numeric key.

Because of this, empty arrays ([]) and empty objects ({}) compare the same, and (for instance) an 'add' of a string key to an empty array will succeed in this implementation where it might fail in others.

$simplexml_mode is provided to help with working with arrays produced from XML in the style of simplexml - e.g. repeated XML elements are expressed as arrays. When $simplexml_mode is enabled, leaves with scalar values are implicitly treated as length-1 arrays, so this test will succeed:

{ "comment": "basic simplexml array promotion",
  "doc": { "foo":1 },
  "patch": [ { "op":"add", "path":"/foo/1", "value":2 } ],
  "expected": { "foo":[1, 2] } },

Also, when $simplexml_mode is true, 1-length arrays are converted to scalars on return from patch().

Tests

Some tests are in a submodule (https://github.com/json-patch/json-patch-tests). Do 'git submodule init' to pull these, then 'php runtests.php' to run them.

Build Status


All versions of json-patch-php with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mikemccabe/json-patch-php contains the following files

Loading the files please wait ....