- Timestamp:
- 09/24/08 23:22:08 (2 months ago)
- Location:
- lang/php/misc/Hermit/src/Hermit
- Files:
-
- 2 modified
-
Hermit.php (modified) (2 diffs)
-
proxy/HermitObjectProxy.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/php/misc/Hermit/src/Hermit/Hermit.php
r19775 r19836 12 12 $trace = $e->getTrace(); 13 13 $class = HermitDaoManager::get($trace[1]['class']); 14 } else if(HermitDaoManager::has($class)){ 15 $class = HermitDaoManager::get($class); 14 16 } 15 17 $this->proxy = self::__create($class); … … 35 37 protected static function __create($targetClass){ 36 38 if(is_object($targetClass)){ 37 return HermitObjectProxy::delegate(new ReflectionObject($targetClas ), $targetClass);39 return HermitObjectProxy::delegate(new ReflectionObject($targetClass), $targetClass); 38 40 } 39 41 $reflector = new ReflectionClass($targetClass); -
lang/php/misc/Hermit/src/Hermit/proxy/HermitObjectProxy.php
r19345 r19836 5 5 */ 6 6 class HermitObjectProxy implements HermitFutureProxy { 7 protected $pdo;8 7 protected $target; 9 8 protected $annote; 10 protected function __construct(PDO $pdo, ReflectionClass $reflector, $target){ 11 $this->pdo = $pdo; 9 protected function __construct(ReflectionClass $reflector, $target){ 12 10 $this->target = $target; 13 11 $this->annote = HermitAnnote::create($reflector); 14 12 } 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); 17 15 } 18 16 public function request($name, array $params){ 19 if($this->annote->hasMethod($name , true)){17 if($this->annote->hasMethod($name)){ 20 18 $method = $this->annote->getMethod($name); 21 19 return $method->invokeArgs($this->target, $params); 22 20 } 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); 24 24 } 25 25 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)