Changeset 226 for FCKreleaser/trunk
- Timestamp:
- 2007-03-27 17:58:03 (21 months ago)
- Location:
- FCKreleaser/trunk
- Files:
-
- 3 modified
-
fckreleaser.php (modified) (5 diffs)
-
_source/includes/fckpackager/common.inc (modified) (4 diffs)
-
_source/includes/fckpackager/fckpreprocessor.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKreleaser/trunk/fckreleaser.php
r165 r226 349 349 function StrEndsWith( $str, $sub ) 350 350 { 351 return ( substr( $str, strlen( $str ) - strlen( $sub ) ) == $sub ) ;351 return ( substr( $str, strlen( $str ) - strlen( $sub ) ) == $sub ) ; 352 352 } 353 353 … … 363 363 { 364 364 $dirParts = explode( '/', $path ) ; 365 365 366 366 $currentDir = '' ; 367 367 … … 369 369 { 370 370 $currentDir .= $dirPart . '/' ; 371 371 372 372 if ( strlen( $dirPart ) > 0 && !is_dir( $currentDir ) ) 373 373 mkdir( $currentDir, $rights ) ; … … 385 385 fwrite( $f, "\xEF\xBB\xBF" ) ; // BOM 386 386 387 fwrite( $f, $strData ) ; 388 fclose( $f ) ; 389 390 return TRUE ; 391 } 392 393 function SaveStringToUtf8File( $strData, $filePath, $includeBom = TRUE ) 394 { 395 $f = @fopen( $filePath, 'wb' ) ; 396 397 if ( !$f ) 398 return FALSE ; 399 400 if ( $includeBom ) 401 fwrite( $f, "\xEF\xBB\xBF" ) ; // BOM 402 403 fwrite( $f, ( $strData ) ) ; 404 387 fwrite( $f, StripUtf8Bom( $strData ) ) ; 405 388 fclose( $f ) ; 406 389 … … 954 937 function ProcessFile( $sourceFilePath, $destinationFilePath, $onlyHeader = FALSE ) 955 938 { 956 SaveStringTo Utf8File(939 SaveStringToFile( 957 940 FCKPreProcessor::Process( file_get_contents( $sourceFilePath ), $onlyHeader ), 958 941 $destinationFilePath, 959 ( !StrEndsWith( $sourceFilePath, '.asp' ) && !StrEndsWith( $sourceFilePath, '.js' ) ) ) ; // Only ASP and JavaScript files require the BOM.942 ( StrEndsWith( $sourceFilePath, '.asp' ) || StrEndsWith( $sourceFilePath, '.js' ) ) ) ; // Only ASP and JavaScript files require the BOM. 960 943 961 944 // Set the destination file Last Access and Last Write times. -
FCKreleaser/trunk/_source/includes/fckpackager/common.inc
r159 r226 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 … … 43 43 { 44 44 $dirParts = explode( '/', $path ) ; 45 45 46 46 $currentDir = '' ; 47 47 … … 49 49 { 50 50 $currentDir .= $dirPart . '/' ; 51 51 52 52 if ( strlen( $dirPart ) > 0 && !is_dir( $currentDir ) ) 53 53 mkdir( $currentDir, $rights ) ; … … 65 65 fwrite( $f, "\xEF\xBB\xBF" ) ; // BOM 66 66 67 fwrite( $f, $strData ) ; 68 fclose( $f ) ; 69 70 return TRUE ; 71 } 72 73 function SaveStringToUtf8File( $strData, $filePath, $includeBom = TRUE ) 74 { 75 $f = @fopen( $filePath, 'wb' ) ; 76 77 if ( !$f ) 78 return FALSE ; 79 80 if ( $includeBom ) 81 fwrite( $f, "\xEF\xBB\xBF" ) ; // BOM 82 83 fwrite( $f, ( $strData ) ) ; 84 67 fwrite( $f, StripUtf8Bom( $strData ) ) ; 85 68 fclose( $f ) ; 86 69 -
FCKreleaser/trunk/_source/includes/fckpackager/fckpreprocessor.inc
r159 r226 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.