Skip to content

Convert PHP 7 files to Zephir zep files and create a native PHP extension

License

Notifications You must be signed in to change notification settings

sandrokeil/php-to-zephir

Repository files navigation

PHP to Zephir

Build Status Coverage Status

Converts PHP 7 files to Zephir zep files and can create Zephir prototype files of external used libraries.

Requirements

  • PHP >= 7.1

Installation

$ composer require --dev sandrokeil/php-to-zephir

Usage

To create Zephir zep files of your PHP files run:

$ bin/php2zephir php2zephir:zep:create [source path/file] [destination path/file]

To create Zephir prototypes for external libraries run:

$ bin/php2zephir php2zephir:prototype:create [source path/file] [destination file prototype.php]

Create PHAR

A PHAR file can be generated with box.

$ php box.phar compile

Unit Tests

$ docker-compose run --rm php vendor/bin/phpunit

Zephir Docker Image

If you want to compile your Zephir zep files for PHP Alpine 3.8 Docker images try my Zephir Docker images.

Limitations

  • Can not handle reserved variable names like $resource, it would result in compilation error

About

Convert PHP 7 files to Zephir zep files and create a native PHP extension

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published