neeckeloo / closure-compiler-php
The Closure Compiler compiles JavaScript into compact, high-performance code.
Installs: 10 709
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 4
Forks: 1
Open Issues: 5
Requires
- php: >=5.3.0
- zendframework/zend-http: 2.*
This package is auto-updated.
Last update: 2024-11-06 09:07:59 UTC
README
The Closure Compiler compiles JavaScript into compact, high-performance code.
Requirements
ClosureCompilerPHP works with PHP 5.3 or later.
Usage
Basic usage
<?php $compiler = new RemoteCompiler(); $compiler->addScript('var a = "hello"; alert(a);'); $response = $compiler->compile(); $compiledCode = $response->getCompiledCode();
File compilation
<?php $compiler = new RemoteCompiler(); $compiler->addLocalFile(__DIR__ . '/script.js'); $response = $compiler->compile(); $compiledCode = $response->getCompiledCode();
Running tests
The tests use PHPUnit