i am making my own class autoloader and and am building an array from the results.
one of my array i would like it to look like
$classes['myTestClass'] = ./classes/myTestClass.class.php
I can build this array but what i cannot do is set the actual class name of the class being loaded as the key to the path.
this is my foreach loop that builds my array
foreach ($classIterator as $file) {
if ($this->_searchFilter($file))
$this->classes[] = $file->getPathname();
}
$file->getPathname() has the absolute path of the class file that will be required, how can i get the class name from that file?
If you are using naming convention so
/classes/myTestClass.class.phpdeclaresmyTestClass, then simplestr_replaceshould be sufficient: