Download the PHP package rcs_us/php-json without Composer

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

php-json

Wrapper for PHP's Native JSON encode/decode that provides very specific exceptions and details as to what is wrong with the JSON.

Install

Install latest version using composer.

Why?

Too often, we come across code that looks like:

The problem with this is no validation of the JSON structure is done. So if you're working with invalid JSON nothing will work as expected.

This library wraps the native json_encode/json_decode functionality, and additionally calls json_last_error(). If JSON_ERROR_NONE is returned ( see http://php.net/manual/en/function.json-last-error.php ), then the value is returned, otherwise a corresponding Exception is thrown.

Several Exceptions are provided, which allows unlimited flexibility on your interaction with potentially invalid JSON.

To catch an Exception of any kind, catch \RCS\JsonException. For any type of encode related issue use \RCS\JsonEncodeException, for any type of decode related issue use \RCS\JsonDecodeException.

If you want to only catch a syntax error when decoding, use \RCS\JsonDecodeErrorSyntaxException. A list of all possible Exceptions are provided below. In short, all JSON error codes have their own exception, for both encoding and decoding.

You can very easily store this in a PSR-7 Middleware.

Details/Usage

Encode example

Decode

Possible Exceptions to catch

  1. \RCS\JsonException ( extends \Exception )
  2. \RCS\JsonDecodeException ( extends \RCS\JsonException )
  3. \RCS\JsonDecodeErrorDepthException ( extends \RCS\JsonDecodeException )
  4. \RCS\JsonDecodeErrorStateMismatchException ( extends \RCS\JsonDecodeException )
  5. \RCS\JsonDecodeErrorCtrlCharException ( extends \RCS\JsonDecodeException )
  6. \RCS\JsonDecodeErrorSyntaxException ( extends \RCS\JsonDecodeException )
  7. \RCS\JsonDecodeErrorUtf8Exception ( extends \RCS\JsonDecodeException )
  8. \RCS\JsonDecodeErrorUnknownException ( extends \RCS\JsonDecodeException )
  9. \RCS\JsonEncodeException ( extends \RCS\JsonException )
  10. \RCS\JsonEncodeErrorDepthException ( extends \RCS\JsonEncodeException )
  11. \RCS\JsonEncodeErrorStateMismatchException ( extends \RCS\JsonEncodeException )
  12. \RCS\JsonEncodeErrorCtrlCharException ( extends \RCS\JsonEncodeException )
  13. \RCS\JsonEncodeErrorSyntaxException ( extends \RCS\JsonEncodeException )
  14. \RCS\JsonEncodeErrorUtf8Exception ( extends \RCS\JsonEncodeException )
  15. \RCS\JsonEncodeErrorUnknownException ( extends \RCS\JsonEncodeException )

All versions of php-json with dependencies

PHP Build Version
Package Version
Requires php Version ^5.2 || ^7.0 || ^8.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 rcs_us/php-json contains the following files

Loading the files please wait ....