Changeset 218

Show
Ignore:
Timestamp:
08/14/07 23:52:27 (1 year ago)
Author:
hans
Message:

#90 - Added support for escaping '.' in imported classpaths

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/classes/phing/Phing.php

    r171 r218  
    912912         
    913913        $dotClassname = basename($dotPath); 
    914         $dotClassnamePos = strlen($dotPath) - strlen($dotClassname); 
    915         $classFile = strtr($dotClassname, '.', DIRECTORY_SEPARATOR) . ".php"; 
     914        $dotClassnamePos = strlen($dotPath) - strlen($dotClassname);  
     915                                                 
     916        // 1- temporarily replace escaped '.' with another illegal char (#)  
     917        $tmp = str_replace('\.', '##', $dotClassname); 
     918        // 2- swap out the remaining '.' with DIR_SEP 
     919        $tmp = strtr($tmp, '.', DIRECTORY_SEPARATOR); 
     920        // 3- swap back the escaped '.' 
     921        $tmp = str_replace('##', '.', $tmp); 
     922         
     923        $classFile = $tmp . ".php"; 
     924         
    916925        $path = substr_replace($dotPath, $classFile, $dotClassnamePos); 
    917926