JSON library for ePHP (part of Bragful)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
include
src
test
.gitignore
.travis.yml
COPYING
Makefile
README.md
codecov.yml
covertool
php.ini
rebar.config
rebar.lock
rebar3

README.md

ePHP JSON

Copyright (c) 2017 Altenwald Solutions, S.L.

Authors: "Manuel Rubio" (manuel@altenwald.com).

Build Status Codecov License: LGPL 2.1

This library implements the JSON functions as is in PHP code for ephp keeping in mind to have it as pure 100% Erlang.

Requirements

ePHP JSON requires to be run over an Erlang/OTP 17+, but not all the versions are full compatible or recommended. See the list:

Erlang Version Support Notes
20.1 ✔️ Recommended if you use OTP 20
20.0 ✔️
19.3 ✔️ Recommended if you use OTP 19
19.2 ✔️
19.1 ✔️
19.0 ✔️
18.3 ✔️ Recommended if you use OTP 18
18.2.1 ✔️
18.2 ✔️
18.1 ✔️
18.0 ✔️
17.5 ✔️ Recommended if you use OTP 17
17.4 ✔️
17.3 fail in SSL
17.1 ✔️
17.0 ✔️

Getting Started

A simple way to use, is include in your project rebar.config the following dependency line:

    {ephp_json, ".*", {git, "git://github.com/bragful/ephp_json.git", master}}

And use the following code in your project:

{ok, Ctx} = ephp:context_new(),
ephp:register_module(Ctx, ephp_lib_json),
PHP = "Empty array output as array: <?=json_encode('tada')?>",
{ok, Text} = ephp:eval(Ctx, PHP).

The result stored in Text should be:

Empty array output as array: "tada"

Enjoy!

Modules

ephp_json
ephp_lib_json