Example #1
0
 protected function getAppname($classname)
 {
     $file = ClassLoader::whereIsClass($classname);
     if (!is_string($file)) {
         return 'yummydummy';
     } else {
         if (!is_file($file)) {
             return 'yummygummy';
         } else {
             // using a heuristic to guess which is the correct application directory name
             $subdirs = preg_split('/[\\/\\\\]/', dirname($file));
             $subdir_count = count($subdirs);
             if ($subdirs[$subdir_count - 2] != 'build') {
                 array_pop($subdirs);
             }
             if ($subdirs[$subdir_count - 2] != 'build') {
                 return 'yummytummy';
             }
             return end($subdirs);
         }
     }
 }