Download the PHP package spomky-labs/cbor-php without Composer

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

CBOR for PHP

Build Status

Scope

This library will help you to decode and create objects using the Concise Binary Object Representation (CBOR - RFC8949).

Installation

Install the library with Composer: composer require spomky-labs/cbor-php.

This project follows the semantic versioning strictly.

Support

I bring solutions to your problems and answer your questions.

If you really love that project, and the work I have done or if you want I prioritize your issues, then you can help me out for a couple of :beers: or more!

Become a sponsor

Or

Become a Patreon

Documentation

Object Creation

This library supports all Major Types defined in the RFC8949 and has capabilities to support any kind of Tags (Major Type 6) and Other Objects (Major Type 7).

Each object have at least:

Positive Integer (Major Type 0)

Negative Integer (Major Type 1)

Byte String / Indefinite Length Byte String (Major Type 2)

Byte String and Indefinite Length Byte String objects have the same major type but are handled by two different classes in this library.

Text String / Indefinite Length Text String (Major Type 3)

Text String and Indefinite Length Text String objects have the same major type but are handled by two different classes in this library.

List / Indefinite Length List (Major Type 4)

List and Indefinite Length List objects have the same major type but are handled by two different classes in this library. Items in the List object can be any of CBOR Object type.

Map / Indefinite Length Map (Major Type 5)

Map and Indefinite Length Map objects have the same major type but are handled by two different classes in this library. Keys and values in the Map object can be any of CBOR Object type.

However, be really careful with keys. Please follow the recommendation hereunder:

Tags (Major Type 6)

This library can support any kind of tags. It comes with some of the thew described in the specification:

You can easily create your own tag by extending the abstract class CBOR\TagObject. This library provides a CBOR\Tag\GenericTag class that can be used for any other unknown/unsupported tags.

Other Objects (Major Type 7)

This library can support any kind of "other objects". It comes with some of the thew described in the specification:

You can easily create your own object by extending the abstract class CBOR\OtherObject. This library provides a CBOR\OtherObject\GenericTag class that can be used for any other unknown/unsupported objects.

Because PHP does not support an 'undefined' object, the normalization method will return 'undefined'.

Example

The encoded result will be 0xa37428efbda1e29795e280bfe29795efbda129e29aa183f5f4c482211904d21907d0f66464617465c11a5e0be100.

Object Loading

If you want to load a CBOR encoded string, you just have to instantiate a CBOR\Decoder class. This class does not need any argument.

If needed, you can define custom sets of Tag and Other Object support managers.

Then, the decoder will read the data you want to load. The data has to be handled by an object that implements the CBOR\Stream interface. This library provides a CBOR\StringStream class to stream the string.

Contributing

Requests for new features, bug fixed and all other ideas to make this project useful are welcome. The best contribution you could provide is by fixing the opened issues where help is wanted.

Please report all issues in the main repository.

Please make sure to follow these best practices.

Licence

This project is release under MIT licence.


All versions of cbor-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-mbstring Version *
brick/math Version ^0.9|^0.10|^0.11|^0.12
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 spomky-labs/cbor-php contains the following files

Loading the files please wait ....