Download the PHP package kingson-de/marshal-serializer without Composer

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

Marshal Serializer

License Build Status Code Coverage Scrutinizer Code Quality

Introduction

Marshal is serializing / marshalling data structures to the desired format. It is also deserializing / unmarshalling the format back to the data structures.

Especially useful for building the raw response for web services which then can be formatted to JSON for example.

If you need to serialize directly to a format, use the appropriate Marshal library:

Installation

Easiest way to install the library is via composer:

The following PHP versions are supported:

Execute tests

Just run:

Or without code coverage:

Usage

Mappers

The first thing to do is to create a mapper that takes care of mapping your entities / models to the correct format.

You always need to inherit from the abstract Mapper class and implement a map function with your type hinting.

There is also the option to use directly a callable to map data. This will be explained later.

It is always possible to use a callable in a mapper or vice versa.

Data Structures

Next step is to create the desired data structure either being an item/object or a collection.

Item/Object

Collection

Serializing / Marshalling

The final step is to map the data structures to the actual format.

You are also not forced to create data structures on your own, you can use the appropriate Marshal functions instead:

Symfony Example

Advanced Mappers

Nested Data Structures

Mappers can even include other mappers with different data structures.

Therefore you can use item, itemCallable, collection or collectionCallable function from the AbstractMapper class.

Pass as many parameters as you like to the mappers

For collections the first parameter passed is the one which Marshal will use for iterating.

All other parameters in a collection will stay as it is.

For items/objects all parameters retain.

Filter out single item's from the collection

Collection mappers can discard single item's by returning null.

Deserializing / Unmarshalling

To transform the actual format back to your structure use Marshal's deserialize functions. You need a class extending the AbstractObjectMapper which will be passed to the deserialize function.

Another option would be to use the deserializeCallable function.

License

This project is released under the terms of the Apache 2.0 license.


All versions of marshal-serializer with dependencies

PHP Build Version
Package Version
Requires php Version ^7.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 kingson-de/marshal-serializer contains the following files

Loading the files please wait ....