Skip to content

MisterLobo/php-zephir-parser

 
 

Repository files navigation

Zephir Parser

Build on Linux Build on Windows

The Zephir Parser delivered as a C extension for the PHP language.

Supported PHP versions: 5.5, 5.6, 7.0, 7.1, 7.2

NOTE: The development branch will always contain the latest unstable version. If you wish to check older versions or formal, tagged release, please switch to the relevant branch/tag.

Get Started

Windows

To install Zephir Parser on Windows:

  1. Download Zephir Parser for Windows
  2. Extract the DLL file and copy it to your PHP extensions directory
  3. Edit your php.ini file and add this line:
    [Zephir Parser]
    extension=zephir_parser.dll
  4. Finally, restart your web server

NOTE: Also you can compile it yourself.

Linux

On a Unix-based platform you can easily compile and install the extension from sources.

Requirements

Prerequisite packages are:

  • OS: Linux || Solaris || FreeBSD || macOS || Windows
  • Compiller: g++ >= 4.4 || clang++ >= 3.x || vc++ >= 11
  • re2c >= 0.13

Ubuntu

sudo apt-get install php7.0-dev gcc make re2c autoconf

Suse

sudo zypper install php7.0-devel gcc make re2c autoconf

CentOS/Fedora/RHEL

sudo yum install php-devel gcc make re2c autoconf

General Compilation

Follow these instructions to generate a binary extension for your platform:

git clone git://github.com/phalcon/php-zephir-parser.git
cd php-zephir-parser
sudo ./install

Add the extension to your php.ini:

[Zephir Parser]
extension=zephir_parser.so

Finally, restart the web server.

Advanced compilation

If you have specific php versions running (for example 7.2):

sudo ./install  --phpize /usr/bin/phpize7.2 --php-config /usr/bin/php-config7.2

Usage

$path   = __DIR__ . '/test.zep';
$retval = zephir_parse_file(file_get_contents($path), $path);

echo PHP_EOL;
var_export($retval);
echo PHP_EOL;

License

Zephir Parser is open source software licensed under the MIT License. See the LICENSE file for more

About

The Zephir Parser delivered as a C extension for the PHP language.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 80.9%
  • Shell 9.0%
  • C++ 5.8%
  • PHP 3.5%
  • Zephir 0.3%
  • M4 0.2%
  • Other 0.3%