- Timestamp:
- 2008-07-23 12:03:16 (6 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/branches/features/new_samples/_dev/releaser/fckreleaser.php
r2040 r2267 82 82 { 83 83 $dirPath = str_replace( '\\', '/', $dirPath ) ; 84 84 85 85 if ( substr( $dirPath, -1, 1 ) != '/' ) 86 86 $dirPath .= '/' ; 87 87 88 88 return $dirPath ; 89 89 } … … 170 170 if ( isset( $releaseNode->Children[ 'IGNOREFILE' ] ) ) 171 171 { 172 $ignoreNodes = $releaseNode->Children[ 'IGNOREFILE' ] ; 172 $ignoreNodes = $releaseNode->Children[ 'IGNOREFILE' ] ; 173 173 foreach ( $ignoreNodes as $ignoreNode ) 174 174 { … … 181 181 if ( isset( $releaseNode->Children[ 'ORIGINALFILE' ] ) ) 182 182 { 183 $originalNodes = $releaseNode->Children[ 'ORIGINALFILE' ] ; 183 $originalNodes = $releaseNode->Children[ 'ORIGINALFILE' ] ; 184 184 foreach ( $originalNodes as $originalNode ) 185 185 { 186 $this->OriginalFiles[] = (object)array( 186 $this->OriginalFiles[] = (object)array( 187 187 'Source' => $originalNode->Attributes[ 'SOURCEPATH' ], 188 188 'Target' => $originalNode->Attributes[ 'TARGETPATH' ] ) ; … … 239 239 while ( $file = readdir( $sourceDirHandler ) ) 240 240 { 241 // Skip ".", ".." and hidden fields (Unix). 241 // Skip ".", ".." and hidden fields (Unix). 242 242 if ( substr( $file, 0, 1 ) == '.' ) 243 243 continue ; … … 327 327 // Project start time (registration at SourceForge, actually = 2003-03-01 18:20). 328 328 $startTime = gmmktime( 18, 20, 0, 3, 1, 2003 ) ; 329 329 330 330 $currentTime = time() ; 331 331 332 332 // Get the number of seconds since the project startup. 333 333 $seconds = $currentTime - $startTime ; … … 597 597 $script = $stringsProc->ProtectStrings( $script ) ; 598 598 599 // Remove "/* */" comments 600 $script = preg_replace( 601 '/(?<!\/)\/\*.*?\*\//s', 602 '', $script ) ; 603 599 604 // Remove "//" comments 600 605 $script = preg_replace( 601 '/\/\/.*$/m', 602 '', $script ) ; 603 604 // Remove "/* */" comments 605 $script = preg_replace( 606 '/(?m-s:^\s*\/\*).*?\*\//s', 607 '', $script ) ; 608 606 '/\/\/.*$/m', 607 '', $script ) ; 608 609 609 // Remove spaces before the ";" at the end of the lines 610 610 $script = preg_replace( … … 966 966 } 967 967 968 // Fix invalid line breaks (must be all CRLF). 969 $data = preg_replace( 970 '/(?:(?<!\r)\n)|(?:\r(?!\n))/im', 971 "\r\n", $data ) ; 972 968 973 return $data ; 969 974 } … … 985 990 function ProtectStrings( $source ) 986 991 { 992 // Catches string literals, regular expressions and conditional comments. 987 993 return preg_replace_callback( 988 '/(?:("|\').*?(?<!\\\\)\1 |(?<![\/\\\\])\/[^\/\*].*?(?<!\\\\)\/)/',994 '/(?:("|\').*?(?<!\\\\)\1)|(?:(?<![\*\/\\\\])\/[^\/\*].*?(?<!\\\\)\/(?=([\.\w])|(\s*[,;}\)])))|(?s:\/\*@(?:cc_on|if|elif|else|end).*?@\*\/)/', 989 995 array( &$this, '_ProtectStringsMatch' ), $source ) ; 990 996 }