How to get the path of a derived class from an inherited method?

Using ReflectionClass::getFileName with this will get you the dirname the class Child is defined on.

$reflector = new ReflectionClass("Child");
$fn = $reflector->getFileName();
return dirname($fn);

You can get the class name of an object with get_class() 🙂

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)