Problem/Motivation
The Google closure compiler JAR file needs to be placed in the module directory, however when calling shell_exec() to run the compiler the JAR path is given relative to the Drupal web root, for example:
java -jar sites/all/modules/contrib/closure_compiler/google_closure_compiler/compiler.jar
This means that locating the JAR file is dependent on the PATH environment variable containing the current working directory '.' for the user account which is running PHP, otherwise the command will fail with a JAR file not found error.
In our case cron was running correctly through drush as the current user, but not when running via Apache.
Proposed resolution
Provide the full path to the JAR file when running the Google closure compiler, for example:
java -jar /var/www/html/sites/all/modules/contrib/closure_compiler/google_closure_compiler/compiler.jar
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | closure_compiler-jar-path-2271895-1.patch | 834 bytes | markpavlitski |
Comments
Comment #1
markpavlitski commentedComment #2
markpavlitski commentedThis path ensures the absolute path is used by prefixing it with DRUPAL_ROOT.
Comment #3
markpavlitski commentedComment #5
nburles commentedMany thanks for the bug reports... and infinitely more for submitting working patches along with them!
I've tested and committed the fixes, and version 2.3 should become available shortly.