Development

Changeset 10328

You must first sign up to be able to contribute.

Changeset 10328

Show
Ignore:
Timestamp:
07/16/08 21:57:21 (2 months ago)
Author:
fabien
Message:

fixed plugin model overriding (closes #3227)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/lib/vendor/propel/Propel.php

    r6003 r10328  
    3232 * @author     Hans Lellelid <hans@xmpl.rg> (Propel) 
    3333 * @author     Daniel Rall <dlr@finemaltcoding.com> (Torque) 
    34  * @author     Magnr Torfason <magnus@handtolvur.is> (Torque) 
     34 * @author     Magnús Þór Torfason <magnus@handtolvur.is> (Torque) 
    3535 * @author     Jason van Zyl <jvanzyl@apache.org> (Torque) 
    3636 * @author     Rafal Krzewski <Rafal.Krzewski@e-point.pl> (Torque) 
     
    552552 
    553553    // check if class exists 
    554     if (class_exists($class, false)) { 
     554    if (class_exists($class, true)) { 
    555555      return $class; 
    556556    } 
  • branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/builder/SfPeerBuilder.php

    r9665 r10328  
    2828    if (!DataModelBuilder::getBuildProperty('builderAddIncludes')) 
    2929    { 
    30       //remove all inline includes: peer class include inline the mapbuilder classes 
     30      // remove all inline includes: peer class include inline the mapbuilder classes 
    3131      $peerCode = preg_replace("/(include|require)_once\s*.*MapBuilder\.php.*\s*/", "", $peerCode); 
    3232    } 
     33 
     34    // change Propel::import() calls to sfPropel::import() 
     35    $peerCode = str_replace('Propel::import(', 'sfPropel::import(', $peerCode); 
     36 
    3337    return $peerCode; 
    3438  } 
  • branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/sfPropel.class.php

    r9870 r10328  
    6262    self::setDefaultCulture($event['culture']); 
    6363  } 
     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  } 
    64104} 
  • branches/1.2/lib/plugins/sfPropelPlugin/lib/propel/builder/SfPeerBuilder.php

    r9665 r10328  
    2828    if (!DataModelBuilder::getBuildProperty('builderAddIncludes')) 
    2929    { 
    30       //remove all inline includes: peer class include inline the mapbuilder classes 
     30      // remove all inline includes: peer class include inline the mapbuilder classes 
    3131      $peerCode = preg_replace("/(include|require)_once\s*.*MapBuilder\.php.*\s*/", "", $peerCode); 
    3232    } 
     33 
     34    // change Propel::import() calls to sfPropel::import() 
     35    $peerCode = str_replace('Propel::import(', 'sfPropel::import(', $peerCode); 
     36 
    3337    return $peerCode; 
    3438  } 
  • branches/1.2/lib/plugins/sfPropelPlugin/lib/propel/sfPropel.class.php

    r9870 r10328  
    6262    self::setDefaultCulture($event['culture']); 
    6363  } 
     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  } 
    64104}