2017 © Pedro Peláez
 

library php-transpiler

Transpiles PHP 5.x into PHP 5.6 or PHP 7 optimized code

image

brownbear/php-transpiler

Transpiles PHP 5.x into PHP 5.6 or PHP 7 optimized code

  • Monday, February 29, 2016
  • by original-brownbear
  • Repository
  • 4 Watchers
  • 20 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 6 Open issues
  • 2 Versions
  • 50 % Grown

The README.md

PHP Transpiler

This tool transpiles PHP code into optimized PHP code., (*1)

Implemented features:, (*2)

  1. Inlines require and include statements., (*3)

  2. Strips unnecessary whitespaces from the code., (*4)

  3. Strips comments from code., (*5)

Example

Run against files test.php and include.php in the same directory given as:, (*6)

test.php, (*7)

<?php

require 'include.php';

class Foo {
    public function msg() {
        return (new Bar)->msg();
    }
}

echo (new Foo)->msg();

include.php, (*8)

<?php

class Bar {
    public function msg() {
        return "Example Return Message\n";  
    }
}

Transpiles into a single test.php that contains:, (*9)

<?php  class Bar{public function msg(){return 'Example Return Message
';}}class Foo{public function msg(){return (new Bar())->msg();}}echo (new Foo())->msg();

For more examples and details on this project see the project page., (*10)

Usage

Installation

To install globally via composer run, (*11)

composer global require brownbear/php-transpiler, (*12)

CLI

Either analyze a source file or directory via:, (*13)

php-transpiler analyze /src

or transpile a source directory into /out via:, (*14)

php-transpiler transpile /src /out

Library

Not documented yet :/, (*15)

Latest Stable Version Latest Unstable Version Minimum PHP Version Build Status Total Downloads Code Climate Test Coverage Dependency Status, (*16)

The Versions

29/02 2016

dev-develop

dev-develop

Transpiles PHP 5.x into PHP 5.6 or PHP 7 optimized code

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

by Armin Braun

18/02 2016

dev-master

9999999-dev

Transpiles PHP 5.x into PHP 5.6 or PHP 7 optimized code

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

by Armin Braun