Example #1
0
function __gwc_autoload($classname)
{
    if (class_exists($classname) || interface_exists($classname)) {
        return FALSE;
    }
    // convert the classname into a filename on disk
    $classFile = __gwc_normalise_path($classname) . '.php';
    return __gwc_include($classFile);
}
Example #2
0
 public function findPhpFilesFromPartialNamespace($partialNamespace)
 {
     // step 1: turn our partial namespace into a needle
     //
     // this makes sure that we have the right DIRECTORY_SEPARATORs
     // for the local operating system
     $needle = \__gwc_normalise_path($partialNamespace);
     // step 2: find the folder(s) that match the namespace
     $folders = $this->findAllMatchingSubFoldersFromIncludeDirs($partialNamespace);
     // step 3: find the PHP files in those folders that are
     // interesting to us
     $files = array();
     foreach ($folders as $folder) {
         $files = array_merge($files, $this->findAllFilesInFolder($folder, '|.php$|'));
     }
     // all done
     return $files;
 }