Exemple #1
0
 public function getDocs($r)
 {
     // note: doc comments are only displayed
     // on first web view after a file is updated,
     // indicating that a bytecode cache is removing comments
     $tpl = new Dase_Template($r);
     $dir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(BASE_PATH . '/lib'));
     foreach ($dir as $file) {
         $matches = array();
         if (false === strpos($file->getPathname(), 'smarty') && false === strpos($file->getPathname(), 'Smarty') && false === strpos($file->getPathname(), 'getid3') && false === strpos($file->getPathname(), 'markdown') && false === strpos($file->getPathname(), 'htaccess') && false === strpos($file->getPathname(), 'svn') && '.' != array_shift(str_split($file->getFilename())) && $file->isFile()) {
             try {
                 $filepath = $file->getPathname();
                 //causes seg fault AND we don't need it
                 //include_once $filepath;
             } catch (Exception $e) {
                 print $e->getMessage() . "\n";
             }
         }
     }
     $arr = get_declared_classes();
     natcasesort($arr);
     //include only
     $filter = create_function('$filename', 'return preg_match("/(dase|mimeparse|service|utlookup)/i",$filename);');
     $class_list = array_filter($arr, $filter);
     //except
     $filter = create_function('$filename', 'return !preg_match("/autogen/i",$filename);');
     $class_list = array_filter($class_list, $filter);
     $tpl->assign('class_list', $class_list);
     if ($r->has('class_id')) {
         $tpl->assign('phpversion', phpversion());
         $tpl->assign('class_id', $r->get('class_id'));
         $documenter = new Documenter($class_list[$r->get('class_id')]);
         $tpl->assign('default_properties', $documenter->getDefaultProperties());
         $tpl->assign('doc', $documenter);
     }
     $r->renderResponse($tpl->fetch('admin/docs.tpl'));
 }