Ver Mensaje Individual
  #7 (permalink)  
Antiguo 03/02/2011, 23:50
JaimeSavines
 
Fecha de Ingreso: octubre-2009
Mensajes: 245
Antigüedad: 14 años, 6 meses
Puntos: 17
Respuesta: ¿Es posible saber el archivo en que se instanció la clase padre?

Vaya creo que te estas complicando, pero bueno puedes usar reflection para obtener la información de la clase te dejo un ejemplo
Código PHP:
Ver original
  1. class Person {
  2.     private $name;    
  3.     private $age;    
  4.     private $id;    
  5.  
  6.     function __construct( $name, $age ) {
  7.         $this->name = $name;
  8.         $this->age = $age;
  9.     }
  10.  
  11.     function setId( $id ) {
  12.         $this->id = $id;
  13.     }
  14.    
  15.     function getId(){
  16.         echo "get id method";    
  17.     }
  18.    
  19.     function __clone() {
  20.         $this->id = 0;
  21.     }
  22. }
  23.  
  24. class ReflectionUtil {
  25.   static function getClassSource( ReflectionClass $class ) {
  26.     $path = $class->getFileName();
  27.     $lines = @file( $path );
  28.     $from = $class->getStartLine();
  29.     $to   = $class->getEndLine();
  30.     $len  = $to-$from+1;
  31.     return implode( array_slice( $lines, $from-1, $len ));
  32.   }
  33. }
  34.  
  35. print ReflectionUtil::getClassSource(
  36.   new ReflectionClass( 'Person' ) );

También revisa estas secciones de la documentación http://www.php.net/manual/en/language.oop5.autoload.php
http://www.php.net/manual/en/language.namespaces.php
__________________
Saludos.