Download the PHP package loadsys/cakephp_serializers without Composer

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

CakePHP-Serializers

Latest Version Build Status Coverage Status Total Downloads

A solution to serialize CakePHP response to JSON and correspondingly deserialize JSON into CakePHP data arrays, designed primarily around building REST APIs with Ember and Ember Data.

This plugin is designed to match the Ember Data and the DS.ActiveModelAdapter for serialization and deserialization of CakePHP generated responses.

Questions on any implementation details can be answered typically using the Test Cases as the final authoritative answer.

This is currently not fully production ready - be warned bugs/issues may exist.

This README is split into the following sections, with additional README documents covering certain topics.

  1. Base Use Case
  2. Requirements
  3. Installation
  4. Basic Setup
  5. Error and Exception Handling Setup
  6. Custom Bake Templates
  7. Advanced Examples
  8. Contributing
  9. License
  10. Copyright

Additional README Documents:

  1. Serialization
  2. Deserialization
  3. Exceptions

Basic Use Case

The basic concept for this plugin is to create an end to end solution for serializing and deserializing CakePHP responses into JSON. This plugin is primarily designed around the use of Ember and Ember Data with the ActiveModelAdapter.

So serializing a CakePHP model data array:

into:

And to perform the reverse, by deserializing data passed in the request body:

or:

into

Requirements

Installation

Composer

Git

Basic Setup

Load the plugin and be sure that bootstrap is set to true:

If you are planning on using this plugin, to deserialize data in an HTTP request a few other changes are required:

When deserializing data and setting your CakePHP controller to respond to REST HTTP requests you will also need to add:

The CakePHP book has more information on doing REST APIs with CakePHP and this feature.

Error and Exception Handling Setup

Errors and Exceptions are handled via a separate CakePHP plugin, included via Composer: SerializersErrors

Please read the documentation there for more information on the specifics.

Modify your app/Config/core.php file to use the Custom Exceptions/Error handling in SerializersErrors.

This does two things:

Custom Bake Templates

There are custom bake templates included in this project for baking your CakePHP Controller classes. Use the serializers template when baking a Controller, to generate a Controller to work with the Serializers Plugin.

The Custom Bake Templates include using the Custom Exception Classes from the above section to provide feedback that matches Ember Data's expectations.

Advanced Examples

We can serialize both multiple records:

into:

And serialize sub model records, even if there are multiple records:

into

The same with deserialize both multiple records:

into

And deserialize sub model records, even if there are multiple records:

into

If there is a second top level model in the data to be serialized it is moved to a property of the first model

into:

If there is a second top level model in the data to be deserialized, it is ignored:

into

Contributing

Reporting Issues

Please use GitHub Isuses for listing any known defects or issues.

Development

When developing this plugin, please fork and issue a PR for any new development.

The Complete Test Suite for the Plugin can be run via this command:

./lib/Cake/Console/cake test Serializers AllSerializers

License

MIT

Copyright

Loadsys Web Strategies 2015


All versions of cakephp_serializers with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
ext-json Version *
composer/installers Version ~1.0
loadsys/cakephp-serializers-errors Version ~1.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 loadsys/cakephp_serializers contains the following files

Loading the files please wait ....