Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sandrokeil/php-to-zephir
Convert PHP 7 files to Zephir zep files and create a native PHP extension
https://github.com/sandrokeil/php-to-zephir
converter extension php php-extension zep zephir zephir-language zephir-php
Last synced: 18 days ago
JSON representation
Convert PHP 7 files to Zephir zep files and create a native PHP extension
- Host: GitHub
- URL: https://github.com/sandrokeil/php-to-zephir
- Owner: sandrokeil
- License: other
- Created: 2018-11-19T19:59:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-08T19:48:47.000Z (over 4 years ago)
- Last Synced: 2024-10-10T10:11:25.553Z (about 1 month ago)
- Topics: converter, extension, php, php-extension, zep, zephir, zephir-language, zephir-php
- Language: PHP
- Homepage:
- Size: 37.1 KB
- Stars: 28
- Watchers: 2
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PHP to Zephir
[![Build Status](https://travis-ci.org/sandrokeil/php-to-zephir.svg?branch=master)](https://travis-ci.org/sandrokeil/php-to-zephir)
[![Coverage Status](https://coveralls.io/repos/sandrokeil/php-to-zephir/badge.svg?branch=master&service=github)](https://coveralls.io/github/sandrokeil/php-to-zephir?branch=master)Converts PHP 7 files to [Zephir](https://zephir-lang.com/en) 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](https://github.com/humbug/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](https://github.com/sandrokeil/docker-files/tree/master/zephir).
## Limitations
- Can not handle reserved variable names like `$resource`, it would result in compilation error