Changeset 335
- Timestamp:
- 2007-05-30 21:36:32 (15 months ago)
- Location:
- FCKpackager/trunk
- Files:
-
- 6 modified
-
fckpackager.exe (modified) (previous)
-
fckpackager.php (modified) (3 diffs)
-
_source/includes/common.inc (modified) (4 diffs)
-
_source/includes/fckpackagefile.inc (modified) (1 diff)
-
_source/includes/fckpreprocessor.inc (modified) (1 diff)
-
web/javascriptcompressor.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKpackager/trunk/fckpackager.php
r156 r335 34 34 // Check the number of arguments passed. The first one is the script name. 35 35 if ( count( $argv ) > 2 ) 36 ExitError( 'Invalid arguments. Operation aborted ' ) ;36 ExitError( 'Invalid arguments. Operation aborted.' ) ; 37 37 38 38 // Get the package definition file … … 45 45 $packager->LoadDefinitionFile( $xmlFileName ) ; 46 46 $packager->Run() ; 47 47 48 ?> 48 49 … … 499 500 500 501 // Each file terminates with a CRLF, even if compressed. 501 $outputData .= "\ n" ;502 $outputData .= "\r\n" ; 502 503 } 503 504 -
FCKpackager/trunk/_source/includes/common.inc
r156 r335 1 <?php1 <?php 2 2 /* 3 3 * FCKpackager - JavaScript Packager and Compressor - http://www.fckeditor.net … … 29 29 function StrEndsWith( $str, $sub ) 30 30 { 31 return ( substr( $str, strlen( $str ) - strlen( $sub ) ) == $sub ) ;31 return ( substr( $str, strlen( $str ) - strlen( $sub ) ) == $sub ) ; 32 32 } 33 33 … … 42 42 function CreateDir($path, $rights = 0777) 43 43 { 44 $folder_path = array( 45 strstr( $path, '.' ) ? dirname( $path ) : $path ) ; 44 $dirParts = explode( '/', $path ) ; 46 45 47 while ( !@is_dir( dirname( end( $folder_path ) ) ) 48 && dirname( end( $folder_path ) ) != '/' 49 && dirname( end( $folder_path ) ) != '.' 50 && dirname( end( $folder_path ) ) != '' ) 46 $currentDir = '' ; 47 48 foreach ( $dirParts as $dirPart ) 51 49 { 52 $folder_path[] = dirname( end( $folder_path ) ) ; 53 } 50 $currentDir .= $dirPart . '/' ; 54 51 55 while ( $parent_folder_path = array_pop( $folder_path ) ) 56 { 57 if ( !@mkdir( $parent_folder_path, $rights ) ) 58 ExitError( "Can't create folder \"$parent_folder_path\"." ) ; 52 if ( strlen( $dirPart ) > 0 && !is_dir( $currentDir ) ) 53 mkdir( $currentDir, $rights ) ; 59 54 } 60 55 } … … 70 65 fwrite( $f, "\xEF\xBB\xBF" ) ; // BOM 71 66 72 fwrite( $f, $strData ) ; 73 fclose( $f ) ; 74 75 return TRUE ; 76 } 77 78 function SaveStringToUtf8File( $strData, $filePath, $includeBom = TRUE ) 79 { 80 $f = @fopen( $filePath, 'wb' ) ; 81 82 if ( !$f ) 83 return FALSE ; 84 85 if ( $includeBom ) 86 fwrite( $f, "\xEF\xBB\xBF" ) ; // BOM 87 88 fwrite( $f, ( $strData ) ) ; 89 67 fwrite( $f, StripUtf8Bom( $strData ) ) ; 90 68 fclose( $f ) ; 91 69 -
FCKpackager/trunk/_source/includes/fckpackagefile.inc
r156 r335 88 88 89 89 // Each file terminates with a CRLF, even if compressed. 90 $outputData .= "\ n" ;90 $outputData .= "\r\n" ; 91 91 } 92 92 -
FCKpackager/trunk/_source/includes/fckpreprocessor.inc
r156 r335 29 29 function ProcessFile( $sourceFilePath, $destinationFilePath, $onlyHeader = FALSE ) 30 30 { 31 SaveStringTo Utf8File(31 SaveStringToFile( 32 32 FCKPreProcessor::Process( file_get_contents( $sourceFilePath ), $onlyHeader ), 33 33 $destinationFilePath, 34 ( !StrEndsWith( $sourceFilePath, '.asp' ) && !StrEndsWith( $sourceFilePath, '.js' ) ) ) ; // Only ASP and JavaScript files require the BOM.34 ( StrEndsWith( $sourceFilePath, '.asp' ) || StrEndsWith( $sourceFilePath, '.js' ) ) ) ; // Only ASP and JavaScript files require the BOM. 35 35 36 36 // Set the destination file Last Access and Last Write times. -
FCKpackager/trunk/web/javascriptcompressor.php
r156 r335 2 2 <?php 3 3 4 require_once( '../ includes/fckcontantprocessor.inc' ) ;5 require_once( '../ includes/fckjavascriptcompressor.inc' ) ;4 require_once( '../_source/includes/fckcontantprocessor.inc' ) ; 5 require_once( '../_source/includes/fckjavascriptcompressor.inc' ) ; 6 6 7 7 if ( isset( $_POST['xInputScript'] ) )