read

I was having trouble locating an error produced by a particular PHP class in a rather cluttered web directory. Because I didn't have access to SSH, grepping was also unfeasible.

As it turns out, PHP has a very useful class called ReflectionClass that has a number of very useful methods for interrogating classes. One of particular interest was in this case was getFileName.

Running the following provided the full server path to the class name in question.

$missing_class = new ReflectionClass('ClassName');

var_dump($missing_class->getFileName());

Beautiful!

Blog Logo

Phil Birnie


Published

Image

Phil Birnie

Full Stack Web Developer from Columbus, Ohio

Back to Overview