Git Product home page Git Product logo

php-closure's People

Watchers

 avatar

php-closure's Issues

Euro symbol break in combine js file

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

Option to save compiled JS to file

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:

Only advancedMode() is working

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

Needs a way to return JS as string

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

Multi-File Compression Fails

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

Externs File?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.