From 3149c9217bd3c8595471d9f62cde4c5d4a0d2884 Mon Sep 17 00:00:00 2001 From: wjames5 Date: Tue, 15 Sep 2009 13:54:56 +0000 Subject: replace packer with yuicompressor (requires java) --- BitThemes.php | 8 ++++++-- 1 file 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 @@ 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 -- cgit v1.3