Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/original-brownbear/php-transpiler

Transpiles PHP code into logically equivalent, performance optimized PHP code
https://github.com/original-brownbear/php-transpiler

Last synced: 8 days ago
JSON representation

Transpiles PHP code into logically equivalent, performance optimized PHP code

Awesome Lists containing this project

README

        

# PHP Transpiler

This tool transpiles PHP code into optimized PHP code.

Implemented features:

1. Inlines `require` and `include` statements.

2. Strips unnecessary whitespaces from the code.

3. Strips comments from code.

## Example

Run against files test.php and include.php in the same directory given as:

test.php
```php
msg();
}
}

echo (new Foo)->msg();
```

include.php

```php
msg();}}echo (new Foo())->msg();
```

For more examples and details on this project see the project [page](http://obrown.io/php-transpiler.html).

## Usage

## Installation

To install globally via composer run

`composer global require brownbear/php-transpiler`

### CLI

Either analyze a source file or directory via:

```
php-transpiler analyze /src
```

or transpile a source directory into `/out` via:

```
php-transpiler transpile /src /out
```

### Library

Not documented yet :/

[![Latest Stable Version](https://poser.pugx.org/brownbear/php-transpiler/v/stable)](https://packagist.org/packages/brownbear/php-transpiler)
[![Latest Unstable Version](https://poser.pugx.org/brownbear/php-transpiler/v/unstable)](//packagist.org/packages/brownbear/php-transpiler)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg?style=flat-square)](https://php.net/)
[![Build Status](https://travis-ci.org/original-brownbear/php-transpiler.svg)](https://travis-ci.org/original-brownbear/php-transpiler)
[![Total Downloads](https://poser.pugx.org/brownbear/php-transpiler/downloads)](https://packagist.org/packages/brownbear/php-transpiler)
[![Code Climate](https://codeclimate.com/github/original-brownbear/php-transpiler/badges/gpa.svg)](https://codeclimate.com/github/original-brownbear/php-transpiler)
[![Test Coverage](https://codeclimate.com/github/original-brownbear/php-transpiler/badges/coverage.svg)](https://codeclimate.com/github/original-brownbear/php-transpiler/coverage)
[![Dependency Status](https://www.versioneye.com/user/projects/567fc289eb4f47003c000092/badge.svg?style=flat)](https://www.versioneye.com/user/projects/567fc289eb4f47003c000092)