Show
Ignore:
Timestamp:
09/20/07 22:47:24 (16 months ago)
Author:
meus
Message:

fixing coding standard $_ infront of private var and removing e from pcre call due to incompatibility with suhosin

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Doctrine.php

    r2565 r2586  
    392392     * @var string $path            doctrine root directory 
    393393     */ 
    394     private static $path; 
     394    private static $_path; 
    395395    /** 
    396396     * @var boolean $_debug 
     
    413413    public static function getPath() 
    414414    { 
    415         if ( ! self::$path) { 
    416             self::$path = dirname(__FILE__); 
    417         } 
    418         return self::$path; 
     415        if ( ! self::$_path) { 
     416            self::$_path = dirname(__FILE__); 
     417        } 
     418        return self::$_path; 
    419419    } 
    420420    /** 
     
    592592            return false; 
    593593        } 
    594         if ( ! self::$path) { 
    595             self::$path = dirname(__FILE__); 
    596         } 
    597         $class = self::$path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR,$classname) . '.php'; 
     594        if ( ! self::$_path) { 
     595            self::$_path = dirname(__FILE__); 
     596        } 
     597        $class = self::$_path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR,$classname) . '.php'; 
    598598 
    599599        if ( ! file_exists($class)) { 
     
    654654    public static function classify($tablename) 
    655655    { 
    656         return preg_replace('~(_?)(_)([\w])~e', '"$1".strtoupper("$3")', ucfirst($tablename)); 
     656        echo "rat"; 
     657        return preg_replace_callback('~(_?)(_)([\w])~', array("Doctrine", "classifyCallback"), ucfirst($tablename)); 
     658    } 
     659 
     660    /** 
     661     * Callback function to classify a classname propperly.  
     662     * 
     663     * @param array $matches An array of matches from a pcre_replace call 
     664     * @return string A string with matches 1 and mathces 3 in upper case.  
     665     */ 
     666    public static function classifyCallback($matches) 
     667    { 
     668        return $matches[1] . strtoupper($matches[3]); 
    657669    } 
    658670    /**