Changeset 10328
- Timestamp:
- 07/16/08 21:57:21 (2 months ago)
- Files:
-
- branches/1.0/lib/vendor/propel/Propel.php (modified) (2 diffs)
- branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/builder/SfPeerBuilder.php (modified) (1 diff)
- branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/sfPropel.class.php (modified) (1 diff)
- branches/1.2/lib/plugins/sfPropelPlugin/lib/propel/builder/SfPeerBuilder.php (modified) (1 diff)
- branches/1.2/lib/plugins/sfPropelPlugin/lib/propel/sfPropel.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/lib/vendor/propel/Propel.php
r6003 r10328 32 32 * @author Hans Lellelid <hans@xmpl.rg> (Propel) 33 33 * @author Daniel Rall <dlr@finemaltcoding.com> (Torque) 34 * @author Magn �r Torfason <magnus@handtolvur.is> (Torque)34 * @author Magnús Þór Torfason <magnus@handtolvur.is> (Torque) 35 35 * @author Jason van Zyl <jvanzyl@apache.org> (Torque) 36 36 * @author Rafal Krzewski <Rafal.Krzewski@e-point.pl> (Torque) … … 552 552 553 553 // check if class exists 554 if (class_exists($class, false)) {554 if (class_exists($class, true)) { 555 555 return $class; 556 556 } branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/builder/SfPeerBuilder.php
r9665 r10328 28 28 if (!DataModelBuilder::getBuildProperty('builderAddIncludes')) 29 29 { 30 // remove all inline includes: peer class include inline the mapbuilder classes30 // remove all inline includes: peer class include inline the mapbuilder classes 31 31 $peerCode = preg_replace("/(include|require)_once\s*.*MapBuilder\.php.*\s*/", "", $peerCode); 32 32 } 33 34 // change Propel::import() calls to sfPropel::import() 35 $peerCode = str_replace('Propel::import(', 'sfPropel::import(', $peerCode); 36 33 37 return $peerCode; 34 38 } branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/sfPropel.class.php
r9870 r10328 62 62 self::setDefaultCulture($event['culture']); 63 63 } 64 65 /** 66 * Include once a file specified in DOT notation and return unqualified classname. 67 * 68 * This method is the same as in Propel::import(). 69 * The only difference is that this one takes the autoloading into account. 70 * 71 * @see Propel::import() 72 */ 73 public static function import($path) 74 { 75 // extract classname 76 if (($pos = strrpos($path, '.')) === false) 77 { 78 $class = $path; 79 } 80 else 81 { 82 $class = substr($path, $pos + 1); 83 } 84 85 // check if class exists 86 if (class_exists($class, true)) 87 { 88 return $class; 89 } 90 91 // turn to filesystem path 92 $path = strtr($path, '.', DIRECTORY_SEPARATOR).'.php'; 93 94 // include class 95 $ret = include_once($path); 96 if ($ret === false) 97 { 98 throw new PropelException("Unable to import class: ".$class." from ".$path); 99 } 100 101 // return qualified name 102 return $class; 103 } 64 104 } branches/1.2/lib/plugins/sfPropelPlugin/lib/propel/builder/SfPeerBuilder.php
r9665 r10328 28 28 if (!DataModelBuilder::getBuildProperty('builderAddIncludes')) 29 29 { 30 // remove all inline includes: peer class include inline the mapbuilder classes30 // remove all inline includes: peer class include inline the mapbuilder classes 31 31 $peerCode = preg_replace("/(include|require)_once\s*.*MapBuilder\.php.*\s*/", "", $peerCode); 32 32 } 33 34 // change Propel::import() calls to sfPropel::import() 35 $peerCode = str_replace('Propel::import(', 'sfPropel::import(', $peerCode); 36 33 37 return $peerCode; 34 38 } branches/1.2/lib/plugins/sfPropelPlugin/lib/propel/sfPropel.class.php
r9870 r10328 62 62 self::setDefaultCulture($event['culture']); 63 63 } 64 65 /** 66 * Include once a file specified in DOT notation and return unqualified classname. 67 * 68 * This method is the same as in Propel::import(). 69 * The only difference is that this one takes the autoloading into account. 70 * 71 * @see Propel::import() 72 */ 73 public static function import($path) 74 { 75 // extract classname 76 if (($pos = strrpos($path, '.')) === false) 77 { 78 $class = $path; 79 } 80 else 81 { 82 $class = substr($path, $pos + 1); 83 } 84 85 // check if class exists 86 if (class_exists($class, true)) 87 { 88 return $class; 89 } 90 91 // turn to filesystem path 92 $path = strtr($path, '.', DIRECTORY_SEPARATOR).'.php'; 93 94 // include class 95 $ret = include_once($path); 96 if ($ret === false) 97 { 98 throw new PropelException("Unable to import class: ".$class." from ".$path); 99 } 100 101 // return qualified name 102 return $class; 103 } 64 104 }