Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bragful/ephp_json
JSON library for ePHP (part of Bragful)
https://github.com/bragful/ephp_json
bragful ephp erlang interpreter json php-library
Last synced: 2 days ago
JSON representation
JSON library for ePHP (part of Bragful)
- Host: GitHub
- URL: https://github.com/bragful/ephp_json
- Owner: bragful
- License: lgpl-2.1
- Created: 2017-07-14T11:59:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-08T01:02:21.000Z (almost 5 years ago)
- Last Synced: 2024-11-09T09:33:20.759Z (about 2 months ago)
- Topics: bragful, ephp, erlang, interpreter, json, php-library
- Language: Erlang
- Homepage: https://bragful.com
- Size: 767 KB
- Stars: 4
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: COPYING
Awesome Lists containing this project
README
# ePHP JSON #
Copyright (c) 2017-2019 Altenwald Solutions, S.L.
__Authors:__ "Manuel Rubio" ([`[email protected]`](mailto:[email protected])).
[![Build Status](https://img.shields.io/travis/bragful/ephp_json/master.svg)](https://travis-ci.org/bragful/ephp_json)
[![Codecov](https://img.shields.io/codecov/c/github/bragful/ephp_json.svg)](https://codecov.io/gh/bragful/ephp_json)
[![License: LGPL 2.1](https://img.shields.io/github/license/bragful/ephp_json.svg)](https://raw.githubusercontent.com/bragful/ephp_json/master/COPYING)This library implements the JSON functions as is in PHP code for [ephp](https://github.com/bragful/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 |
|:---|:---:|:---|
| 22.1 | :heavy_check_mark: | Recommended if you use OTP 22 |
| 22.0 | :heavy_check_mark: | |
| 21.3 | :heavy_check_mark: | Recommended if you use OTP 21 |
| 21.2 | :heavy_check_mark: | |
| 21.1 | :heavy_check_mark: | |
| 21.0 | :heavy_check_mark: | |
| 20.3 | :x: | Fails in math and number conversion |
| 20.2 | :heavy_check_mark: | Recommended if you use OTP 20 |
| 20.1 | :heavy_check_mark: | |
| 20.0 | :heavy_check_mark: | |
| 19.3 | :heavy_check_mark: | Recommended if you use OTP 19 |
| 19.2 | :heavy_check_mark: | |
| 19.1 | :heavy_check_mark: | |
| 19.0 | :heavy_check_mark: | |
| 18.3 | :heavy_check_mark: | Recommended if you use OTP 18 |
| 18.2.1 | :heavy_check_mark: | |
| 18.2 | :heavy_check_mark: | |
| 18.1 | :heavy_check_mark: | |
| 18.0 | :heavy_check_mark: | |### Getting Started ###
A simple way to use, is include in your project `rebar.config` the following dependency line:
```erlang
{ephp_json, ".*", {git, "git://github.com/bragful/ephp_json.git", master}}
```And use the following code in your project:
```erlang
{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 ##