Download the PHP package xp-forge/json without Composer

On this page you can find all versions of the php package xp-forge/json. 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

JSON

Build status on GitHub XP Framework Mdodule BSD Licence Requires PHP 7.0+ Supports PHP 8.0+ Latest Stable Version

Reads and writes JSON to and from various input sources.

Examples

Reading can be done from a string using one of the Input implementations:

Writing can be done to a string or using one of the Output implementations:

Formatted output

To change the output format, pass a Format instance to the output's constructor. The formats available are:

The available options that can be or'ed together are:

The above code will yield the following output:

Sequential processing

Processing elements sequentially can save you memory and give a better performance in certain situations.

Reading

You can use the elements() method to receive an iterator over a JSON array. Instead of loading the entire source into memory and then returning the parsed array, it will parse one array element at a time, yielding them while going.

If you get a huge object, you can also process it sequentially using the pairs() method. This will parse a single key/value pair at a time.

To detect the type of the data on the stream (again, without reading it completely), you can use the type() method.

Writing

To write data sequentially, you can use the begin() method and the stream it returns. This makes sense when the source offers a way to read data sequentially, if you already have the entire data in memory, using write() has the same effect.

As the Stream class implements the Closeable interface, it can be used in the with statement:

Further reading


All versions of json with dependencies

PHP Build Version
Package Version
Requires xp-framework/core Version ^12.0 | ^11.0 | ^10.0
php Version >=7.0.0
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 xp-forge/json contains the following files

Loading the files please wait ....