Git Product home page Git Product logo

ephp's Introduction

ePHP

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

Authors: "Manuel Rubio" ([email protected]).

Build Status Codecov License: LGPL 2.1

PHP Interpreter pure 100% Erlang. This interpreter was made for enhance and give flexibility to projects that requires an interface for plugins or addons without new compilations.

In the same way, you can use for server PHP pages in an easy way.

The port is not 100% complete, please refer to compatibility table.

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

Erlang Version Support Notes
19.2 ✔️ Recommended if you use OTP 19
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.2 no tests available in Travis-CI
17.1 ✔️
17.0 ✔️
R16B03-1 ✔️ Recommended if you use OTP R16
R16B03 ✔️
R16B02 ✔️
R16B01 fails in math lib

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

    {ephp, ".*", {git, "git://github.com/altenwald/ephp.git", master}}

And use the following code in your project:

{ok, Ctx} = ephp:context_new(),
PHP = "<? $a = 5 * 23; ?>Result for $a = <?=$a?>",
{ok, Text} = ephp:eval(Ctx, PHP).

The result stored in Text should be:

Result for $a = 115

PHP has a lot of built-in libraries. This interpreter has a little implementation of them. You can see the functions in the compatibility table.

You can add your own functions specifying the PHP name, and the module and function, as follow:

ephp_context:register_func(Ctx, <<"time">>, ephp_lib_date, time).

Modules

ephp
ephp_array
ephp_class
ephp_config
ephp_const
ephp_context
ephp_data
ephp_datetime
ephp_error
ephp_func
ephp_include
ephp_interpr
ephp_lib_array
ephp_lib_class
ephp_lib_control
ephp_lib_date
ephp_lib_error
ephp_lib_file
ephp_lib_func
ephp_lib_info
ephp_lib_math
ephp_lib_misc
ephp_lib_ob
ephp_lib_string
ephp_lib_vars
ephp_output
ephp_parser
ephp_parser_class
ephp_parser_expr
ephp_parser_func
ephp_parser_string
ephp_shutdown
ephp_string
ephp_timezone
ephp_vars

ephp's People

Contributors

bitdeli-chef avatar manuel-rubio avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.