Changeset 2586 for trunk/lib/Doctrine.php
- Timestamp:
- 09/20/07 22:47:24 (16 months ago)
- Files:
-
- 1 modified
-
trunk/lib/Doctrine.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Doctrine.php
r2565 r2586 392 392 * @var string $path doctrine root directory 393 393 */ 394 private static $ path;394 private static $_path; 395 395 /** 396 396 * @var boolean $_debug … … 413 413 public static function getPath() 414 414 { 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; 419 419 } 420 420 /** … … 592 592 return false; 593 593 } 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'; 598 598 599 599 if ( ! file_exists($class)) { … … 654 654 public static function classify($tablename) 655 655 { 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]); 657 669 } 658 670 /**