Is it possible to find the location of a class file by namespace?

I recently worked with pyroCms. This is a really good CMS. But I saw that the file used the php namespace.

<?php use Capsule\Schema; /** * Blog module * * @author PyroCMS Dev Team * @package PyroCMS\Core\Modules\Blog */ class Module_Blog extends Module { } 

So now I want to find the location of the Schema class file. How can i do this? I read the documentation for the php class. But did not receive any help.

Is there any other method or trick?

+4
source share
1 answer

If you have autoload installed:

 $r = new ReflectionClass('Capsule\Schema'); echo $r->getFileName(); 

Usually, namespaces and class names should match the names of directories and files (although they are optional). A decent editor / IDE should also make global search easy, at worst, with regular expression searches for " class\s+Schema ".

+5
source

All Articles