Show
Ignore:
Timestamp:
2008-07-23 12:03:16 (6 months ago)
Author:
martinkou
Message:

Merged all changes in trunk up to r2266.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/branches/features/new_samples/_dev/releaser/fckreleaser.php

    r2040 r2267  
    8282{ 
    8383        $dirPath = str_replace( '\\', '/', $dirPath ) ; 
    84  
     84         
    8585        if ( substr( $dirPath, -1, 1 ) != '/' ) 
    8686                $dirPath .= '/' ; 
    87  
     87         
    8888        return $dirPath ; 
    8989} 
     
    170170                if ( isset( $releaseNode->Children[ 'IGNOREFILE' ] ) ) 
    171171                { 
    172                         $ignoreNodes = $releaseNode->Children[ 'IGNOREFILE' ] ; 
     172                        $ignoreNodes = $releaseNode->Children[ 'IGNOREFILE' ] ;  
    173173                        foreach ( $ignoreNodes as $ignoreNode ) 
    174174                        { 
     
    181181                if ( isset( $releaseNode->Children[ 'ORIGINALFILE' ] ) ) 
    182182                { 
    183                         $originalNodes = $releaseNode->Children[ 'ORIGINALFILE' ] ; 
     183                        $originalNodes = $releaseNode->Children[ 'ORIGINALFILE' ] ;      
    184184                        foreach ( $originalNodes as $originalNode ) 
    185185                        { 
    186                                 $this->OriginalFiles[] = (object)array( 
     186                                $this->OriginalFiles[] = (object)array(  
    187187                                        'Source' => $originalNode->Attributes[ 'SOURCEPATH' ], 
    188188                                        'Target' => $originalNode->Attributes[ 'TARGETPATH' ] ) ; 
     
    239239                while ( $file = readdir( $sourceDirHandler ) ) 
    240240                { 
    241                         // Skip ".", ".." and hidden fields (Unix). 
     241                        // Skip ".", ".." and hidden fields (Unix).  
    242242                        if ( substr( $file, 0, 1 ) == '.' ) 
    243243                                continue ; 
     
    327327                // Project start time (registration at SourceForge, actually = 2003-03-01 18:20). 
    328328                $startTime = gmmktime( 18, 20, 0, 3, 1, 2003 ) ; 
    329  
     329                 
    330330                $currentTime = time() ; 
    331  
     331                 
    332332                // Get the number of seconds since the project startup. 
    333333                $seconds = $currentTime - $startTime ; 
     
    597597                $script = $stringsProc->ProtectStrings( $script ) ; 
    598598 
     599                // Remove "/* */" comments 
     600                $script = preg_replace( 
     601                        '/(?<!\/)\/\*.*?\*\//s', 
     602                        '', $script ) ; 
     603 
    599604                // Remove "//" comments 
    600605                $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                 
    609609                // Remove spaces before the ";" at the end of the lines 
    610610                $script = preg_replace( 
     
    966966                } 
    967967 
     968                // Fix invalid line breaks (must be all CRLF). 
     969                $data = preg_replace( 
     970                        '/(?:(?<!\r)\n)|(?:\r(?!\n))/im', 
     971                        "\r\n", $data ) ; 
     972 
    968973                return $data ; 
    969974        } 
     
    985990        function ProtectStrings( $source ) 
    986991        { 
     992                // Catches string literals, regular expressions and conditional comments. 
    987993                return preg_replace_callback( 
    988                         '/(?:("|\').*?(?<!\\\\)\1|(?<![\/\\\\])\/[^\/\*].*?(?<!\\\\)\/)/', 
     994                        '/(?:("|\').*?(?<!\\\\)\1)|(?:(?<![\*\/\\\\])\/[^\/\*].*?(?<!\\\\)\/(?=([\.\w])|(\s*[,;}\)])))|(?s:\/\*@(?:cc_on|if|elif|else|end).*?@\*\/)/', 
    989995                        array( &$this, '_ProtectStringsMatch' ), $source ) ; 
    990996        }