protected function _minify( $package, $debug, $permissions )
	{
		$content = '';
		$ds = DIRECTORY_SEPARATOR;

		foreach( $this->_getFilenames( $package, $this->_basePath ) as $filename )
		{
			if( $ds !== '/' ) {
				$filename = str_replace( '/', $ds, $filename );
			}

			if( ( $content .= file_get_contents( $filename ) ) === false ) {
				throw new MW_Jsb2_Exception( sprintf( 'Unable to get content of file "%1$s"', $filename ) );
			}
		}

		if( $debug !== true ) {
			$content = JSMin::minify( $content );
		}

		$pkgFileName = $this->_basePath . $this->_deployDir . $package->file;

		if( $ds !== '/' ) {
			$pkgFileName = str_replace( '/', $ds, $pkgFileName );
		}

		if( file_put_contents( $pkgFileName, $content ) === false ) {
			throw new MW_Jsb2_Exception( sprintf( 'Unable to create package file "%1$s"', $pkgFileName ) );
		}

		if( chmod( $pkgFileName, $permissions ) === false ) {
			throw new MW_Jsb2_Exception( sprintf( 'Unable to change permissions of file "%1$s"', $pkgFileName ) );
		}
	}
protected function _minify( $package, $debug, $permissions )
	{
		$content = '';
		$ds = DIRECTORY_SEPARATOR;

		foreach( $this->_getFilenames( $package, $this->_basePath ) as $filename )
		{
			if( $ds !== '/' ) {
				$filename = str_replace( '/', $ds, $filename );
			}

			if( ( $content .= file_get_contents( $filename ) ) === false ) {
				throw new MW_Jsb2_Exception( sprintf( 'Unable to get content of file "%1$s"', $filename ) );
			}
		}

		if( $debug !== true ) {
			$content = JSMin::minify( $content );
		}

		$pkgFileName = $this->_basePath . $this->_deployDir . $package->file;

		if( $ds !== '/' ) {
			$pkgFileName = str_replace( '/', $ds, $pkgFileName );
		}

		if( file_put_contents( $pkgFileName, $content ) === false ) {
			throw new MW_Jsb2_Exception( sprintf( 'Unable to create package file "%1$s"', $pkgFileName ) );
		}

		if( chmod( $pkgFileName, $permissions ) === false ) {
			throw new MW_Jsb2_Exception( sprintf( 'Unable to change permissions of file "%1$s"', $pkgFileName ) );
		}
	}
protected function _minify ( $ package , $ debug , $ permissions ) { $ content = '' ; $ ds = DIRECTORY_SEPARATOR ; foreach ( $ this -> _getFilenames ( $ package , $ this -> _basePath ) as $ filename ) { if ( $ ds !== '/' ) { $ filename = str_replace ( '/' , $ ds , $ filename ) ; } if ( ( $ content .= file_get_contents ( $ filename ) ) === false ) { throw new MW_Jsb2_Exception ( sprintf ( 'Unable to get content of file "%1$s"' , $ filename ) ) ; } } if ( $ debug !== true ) { $ content = JSMin :: minify ( $ content ) ; } $ pkgFileName = $ this -> _basePath . $ this -> _deployDir . $ package -> file ; if ( $ ds !== '/' ) { $ pkgFileName = str_replace ( '/' , $ ds , $ pkgFileName ) ; } if ( file_put_contents ( $ pkgFileName , $ content ) === false ) { throw new MW_Jsb2_Exception ( sprintf ( 'Unable to create package file "%1$s"' , $ pkgFileName ) ) ; } if ( chmod ( $ pkgFileName , $ permissions ) === false ) { throw new MW_Jsb2_Exception ( sprintf ( 'Unable to change permissions of file "%1$s"' , $ pkgFileName ) ) ; } }
Creates minified file for given package using JSMin.

@param object $package Package object from manifest to minify
@param boolean $debug Create debug files if true
@param integer $permissions File permissions to set on new files
Creates minified file for given package using JSMin .