summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwjames5 <will@tekimaki.com>2009-09-15 13:54:56 +0000
committerwjames5 <will@tekimaki.com>2009-09-15 13:54:56 +0000
commit3149c9217bd3c8595471d9f62cde4c5d4a0d2884 (patch)
tree27abe4bda1251632e5e0ac44609f5c30570ffa86
parent5626fe5e08fd32121157fe549af8a77af3f3f389 (diff)
downloadthemes-3149c9217bd3c8595471d9f62cde4c5d4a0d2884.tar.gz
themes-3149c9217bd3c8595471d9f62cde4c5d4a0d2884.tar.bz2
themes-3149c9217bd3c8595471d9f62cde4c5d4a0d2884.zip
replace packer with yuicompressor (requires java)
-rw-r--r--BitThemes.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/BitThemes.php b/BitThemes.php
index 72e0f16..dc9dbc4 100644
--- a/BitThemes.php
+++ b/BitThemes.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_themes/BitThemes.php,v 1.100 2009/05/11 19:55:34 tekimaki_admin Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_themes/BitThemes.php,v 1.101 2009/09/15 13:54:56 wjames5 Exp $
* @package themes
*/
@@ -1293,16 +1293,20 @@ class BitThemes extends BitBase {
global $gBitSystem;
$ret = FALSE;
if( !empty( $pJavascriptFile )) {
- if( $pPack && $gBitSystem->isFeatureActive( 'themes_packed_js_css' )) {
+ if( $pPack && $gBitSystem->isFeatureActive( 'themes_packed_js_css' ) && shell_exec( 'which java' ) ) {
if( is_file( $pJavascriptFile )) {
// get a name for the cache file we're going to store
$cachefile = md5( $pJavascriptFile ).'.js';
// if the file hasn't been packed and cached yet, we do that now.
if( !$this->mThemeCache->isCached( $cachefile, filemtime( $pJavascriptFile ))) {
+ /* DEPRECATED in favor of better yui compressor
require_once( UTIL_PKG_PATH.'javascript/class.JavaScriptPacker.php' );
$packer = new JavaScriptPacker( file_get_contents( $pJavascriptFile ) );
$this->mThemeCache->writeCacheFile( $cachefile, $packer->pack() );
+ */
+ $cacheData = shell_exec( 'java -jar '.UTIL_PKG_PATH.'yui/yuicompressor-2.4.2.jar --type js '.$pJavascriptFile );
+ $this->mThemeCache->writeCacheFile( $cachefile, $cacheData );
}
// update javascript file with new path