weborganics / php-closure Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/php-closure
Automatically exported from code.google.com/p/php-closure
What steps will reproduce the problem?
1. page encoding is ISO-8859-1, js file encoding in cp-1252
2. combine js files using api & phpClosure
What is the expected output? What do you see instead?
€ should be convert to \u02ac, but its showing either ? or if use
mb_convert_encoding with file_get_content than it gets converted to \u0080
What version of the product are you using? On what operating system?
Using centos 6.0.1 & php 5.4
Original issue reported on code.google.com by [email protected]
on 4 Apr 2014 at 4:40
Enhance by appending Unix timestamp to .js filenames. This will circumvent
browsers' use of old .js files which breaks your site.
Instead of generating X.js filenames, generate X.timestamp.js filenames.
Original issue reported on code.google.com by [email protected]
on 28 Jan 2015 at 10:15
optionally save the compiled JS to file through the write() function
* $c->add("my-app.js")
* ->add("popup.js")
* ->advancedMode()
* ->useClosureLibrary()
* ->cacheDir("/tmp/js-cache/")
* ->write("compiled.js");
Original issue reported on code.google.com by [email protected]
on 25 Aug 2011 at 3:08
Attachments:
All nice and shiny, upgraded to PHP 5 features
Original issue reported on code.google.com by [email protected]
on 6 Jul 2011 at 12:51
Attachments:
What steps will reproduce the problem?
1. Copy your code from trunk and save it as _closure_comp.php
2. used your small sample code and save it as _compilejs.php
_compilejs.php
<?php
include("_closure_comp.php"); // my copy of your file
$cc = new PhpClosure();
$cc -> add("js/adm_mod.js")
-> advancedMode()
-> useClosureLibrary()
-> cacheDir("jsmin/")
-> write();
?>
3. Call _compilejs.php
What is the expected output?
- When using advancedMode(), its working
- When using whitespaceOnly(), its NOT working
- When using simpleMode(), its NOT working
What do you see instead?
A lot of junk and files are bigger than originals...!
Sample
________________
var
COMPILED=!0,goog=goog||{};goog.global=this;goog.exportPath_=function(a,b,c){a=a.
split(".");c=c||goog.global;a[0]in c||!c.execScript||c.execScript("var
"+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void
0===b?c=c[d]?c[d]:c[d]={}:c[d]=b};
goog.define=function(a,b){var
c=b;COMPILED||(goog.global.CLOSURE_UNCOMPILED_DEFINES&&Object.prototype.hasOwnPr
operty.c¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
etc...
What version of the product are you using? On what operating system?
Revision 9 on Win7 and Chrome
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 22 Jul 2014 at 7:28
Just a suggestion, but it should would be handy to return the source as a
string instead of echoing it.
function returnJS($compile=true){
if($compile == TRUE){
return $this->_compile();
}else{
$scripts = '';
foreach($this->_srcs as $src){
$scripts .= @file_get_contents($src);
}
return $scripts;
}
}
Original issue reported on code.google.com by keith%[email protected]
on 15 Dec 2010 at 7:59
What steps will reproduce the problem?
1. Add two JS files that define a function/object (each file a function/object).
2. Compile...
Instead of merging both JS files correctly, it's joining them to something like
this:
foo = function(){
//code
}bar = function(){
//more code
}
Google closure compiler won't compile and throws:
JSC_PARSE_ERROR: Parse error. missing ; before statement.
Solution:
php-closure.php, line 351, replace:
$code .= file_get_contents($src);
- with-
$code .= "\n".file_get_contents($src);
Fixed!
Original issue reported on code.google.com by [email protected]
on 22 Jul 2010 at 2:50
Is there any way to get this to work with an externs file?
something similar to this?
java -jar compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS \
--js=../src/script1.js \
--js=../src/script2.js \
--js=../src/script3.js \
--js=../src/script4.js \
--externs ../src/externs1.js \
--js_output_file=../release/code.js
Original issue reported on code.google.com by [email protected]
on 7 Mar 2015 at 7:51
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.