Download the PHP package klkvsk/json-decode-stream without Composer

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

json-decode-stream

Min PHP version Build Status Scrutinizer tests Scrutinizer coverage Scrutinizer code quality Packagist version

This is a JSON parsing library that allows parsing stream of JSON data. You can process JSON records on the fly without decoding complete structure into memory first. This is especially useful when parsing large JSON files.

Installation

Basic usage

In most cases, streaming parser is used to parse lists of repeated objects. For example, here is a list of users:

To iterate over each user and print their name, use:

Documentation

json-decode-stream uses layered generators to process data. There are 3 layers, and the processing goes as follows:

Parser class provides access to each layer directly, but for most use cases only $parser->items($selector) is needed.

Selectors

Selector is a string that specifies full path to collected JSON fields. Simple selectors are:

Selectors can be nested:

Reference

Parser

Constructors:

Methods:

Event

Methods:

Token

Custom Collectors

CollectorInterface defines only one method:

Return an array of [ key, value ] to be yielded from items() when you need to emit an item.

Yield multiple [ key, value ]s when you need to emit multiple items.

Otherwise, return null if you have nothing yet to yield.

Here is an example of custom Collector:

Dependencies

There are no external dependencies except ext-json, which is normally comes with every PHP distribution.

Default json_decode is used to parse single JSON strings when Parser finds them. This is faster and more error-proof than writing own JSON string parser/validator.

Testing

This lib is heavily covered with unit tests and CI-tested under all versions of PHP since 7.1.

To run tests, install via composer with --dev and run

License

This code is distributed under MIT license.


All versions of json-decode-stream with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ext-json Version *
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 klkvsk/json-decode-stream contains the following files

Loading the files please wait ....