Download the PHP package tcds-io/php-jackson without Composer

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

PHP-Jackson

PHP Tests

A lightweight, flexible object serializer for PHP, inspired by Jackson.

It provides strong typing, JSON ↔ object mapping, generics support, array/object shapes, custom type mappers, and detailed error tracing.

📚 Contents


Overview

Main components:


🚀 Installation

🧩 Integrations

PHP Jackson offers first-class integrations for popular PHP frameworks and tools. Each integration extends the core mapper with framework-specific features for a smoother development experience.

Official Plugins:

🔧 Basic Usage

Reading JSON into typed objects

Equivalent array version:


📥 Deserializing from JSON

The resulting object matches:


➕ Merging Additional Data (readValueWith)

Merging data is useful when the incoming payload does not contain all required values and those values must be completed from another source:


📤 Serializing Objects

Array output:

JSON output:


📚 Generic Types (list<T>, map<K,V>, shapes)

The generic() and shape() helper functions are loaded by Composer through php-better-generics.

List example

Using generic():


Map example


Array Shape Example

Produces:


Object Shape Example

Produces a stdClass:


🏷️ Renaming JSON keys with #[JsonProperty]

PHP-Jackson maps JSON keys to PHP names 1:1 by default. When the wire format uses a different naming convention (snake_case, kebab-case, etc.), pin the JSON key on the constructor parameter (or property) with #[JsonProperty]:

The attribute is honored on both directions:

Error traces and the expected payload on UnableToParseValue use the wire key — the one users will recognize from the JSON they are sending — not the PHP identifier.


🧩 Custom Type Mappers

Custom mappers are useful when object construction depends on complex logic or external data:

This allows:

to become:

and serialize back into:


Using Custom Mappers with External Context

Mapper closures can receive any of the named arguments used internally by PHP-Jackson:

Use only the parameters you need; ReflectionFunction::call() binds them by name.


Pinning a Mapper on the Class with #[JsonMapper]

If a class always wants the same custom (de)serialization, declare it once on the class itself instead of registering it on every mapper instance:

The reader and writer accept any of:

Resolution order on every read/write:

  1. #[JsonMapper] attribute on the target class — declaration site, wins
  2. typeMappers constructor argument
  3. default reader/writer

That is, an explicit class-level mapper cannot be silently overridden by mapper-instance config — the class itself is the canonical source.


🕒 Date Handling

PHP-Jackson provides built-in support for:

Dates are serialized and deserialized using ISO-8601 strings:


❗ Error Handling

When parsing fails, the library throws:

UnableToParseValue

Properties:

Example message:

This makes debugging extremely easy.


🔧 Development


✅ Summary

You can:


All versions of php-jackson with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-json Version *
tcds-io/php-better-generics 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 tcds-io/php-jackson contains the following files

Loading the files please wait ...