Changeset 19836 for lang/php

Show
Ignore:
Timestamp:
09/24/08 23:22:08 (2 months ago)
Author:
nowelium
Message:
 
Location:
lang/php/misc/Hermit/src/Hermit
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/php/misc/Hermit/src/Hermit/Hermit.php

    r19775 r19836  
    1212            $trace = $e->getTrace(); 
    1313            $class = HermitDaoManager::get($trace[1]['class']); 
     14        } else if(HermitDaoManager::has($class)){ 
     15          $class = HermitDaoManager::get($class); 
    1416        } 
    1517        $this->proxy = self::__create($class); 
     
    3537    protected static function __create($targetClass){ 
    3638        if(is_object($targetClass)){ 
    37             return HermitObjectProxy::delegate(new ReflectionObject($targetClas), $targetClass); 
     39            return HermitObjectProxy::delegate(new ReflectionObject($targetClass), $targetClass); 
    3840        } 
    3941        $reflector = new ReflectionClass($targetClass); 
  • lang/php/misc/Hermit/src/Hermit/proxy/HermitObjectProxy.php

    r19345 r19836  
    55 */ 
    66class HermitObjectProxy implements HermitFutureProxy { 
    7     protected $pdo; 
    87    protected $target; 
    98    protected $annote; 
    10     protected function __construct(PDO $pdo, ReflectionClass $reflector, $target){ 
    11         $this->pdo = $pdo; 
     9    protected function __construct(ReflectionClass $reflector, $target){ 
    1210        $this->target = $target; 
    1311        $this->annote = HermitAnnote::create($reflector); 
    1412    } 
    15     public static function delegate(PDO $pdo, ReflectionClass $reflector, $instance = null){ 
    16         return new self($pdo, $reflector, $instance); 
     13    public static function delegate(ReflectionClass $reflector, $instance = null){ 
     14        return new self($reflector, $instance); 
    1715    } 
    1816    public function request($name, array $params){ 
    19         if($this->annote->hasMethod($name, true)){ 
     17        if($this->annote->hasMethod($name)){ 
    2018            $method = $this->annote->getMethod($name); 
    2119            return $method->invokeArgs($this->target, $params); 
    2220        } 
    23         throw new BadMethodCallException(get_class($this->target) . '::' . $name); 
     21        $pdo = HermitDataSourceManager::get($this->reflector->getName()); 
     22        $command = $this->commandFactory->create($pdo, $name); 
     23        return $command->execute($pdo, $params); 
    2424    } 
    2525}