Download the PHP package oire/serializer without Composer

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

Oiré Serializer — Data Serializer for Better Storage and Exchange

Build Status MIT License

Serializes various data to different formats. There is also a possibility to additionally encode the output to URL-and filename-safe base64.
Depends on Oirë Base64 for encoding binary data to a storable format.

Requirements

Requires PHP 7.1 or later with JSON support enabled.
Requires additional PECL extensions for certain serialization modes, see below. If no PECL is available and none of the required extensions is installed in your environment (such a shared hosting), you can freely use Oirë Serializer with JSON.

Installation

Via Composer:

composer require oire/serializer

Or manually. Note that you will need base64.php from Oirë Base64:

Running Tests

Run phpunit in the projects directory.

Usage Examples

Serialization to JSON. Note that you can either call methods consequently or chain them, like this:

This will output:

Now unserializing:

This will return the original array. If you want to get an object instead, pass false as the third parameter to unserialize().
If you pass true as the second parameter to serialize(), the serialized data will be additionally encoded to URL-and filename-safe base64. This might be particularly useful if you choose a binary format such as MessagePack:

This will output:

Supported Serialization Modes

Currently the following modes are supported. Note, if the mode is binary, a raw binary string is returned if $base64 parameter is left as false during serialization which can be uncomfortable for reading or storage.

Methods

The methods are documented in the source file, but their description is given below.
We recommend to wrap every call in try...catch since Oirë Serializer throws exceptions in case of errors.

License

Copyright © 2017, Andre Polykanine also known as Menelion Elensúlë.
This software is licensed under an MIT license.


All versions of serializer with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.1
oire/base64 Version >= 1.1
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 oire/serializer contains the following files

Loading the files please wait ....