Ticket #204: pear_style_task_class.diff

File pear_style_task_class.diff, 1.0 kB (added by Markus Fischer <markus@fischer.name>, 7 months ago)

Patch resolving classes with PEAR naming convention if traditional resolving fails

  • classes/phing/Project.php

    old new  
    601601            } 
    602602             
    603603            if (!class_exists($cls)) { 
    604                 throw new BuildException("Could not instantiate class $cls, even though a class was specified. (Make sure that the specified class file contains a class with the correct name.)"); 
     604                # Try PEAR naming schema before throwing exception 
     605                $sFullClass = str_replace('.', '_', $class); 
     606                if (!class_exists($sFullClass)) { 
     607                    throw new BuildException("Could not find class $cls or $sFullClass, even though a class was specified. (Make sure that the specified class file contains a class with the correct name.)"); 
     608                } else { 
     609                    $cls = $sFullClass; 
     610                } 
    605611            } 
    606612             
    607613            $o = new $cls();