Beispiel #1
0
 public function generate()
 {
     if (!$this->doc->isGenerable()) {
         $this->onMissing(__FUNCTION__);
     } else {
         try {
             $scanner = $this->doc->getScanner();
             $startParse = microtime();
             $scanner->start();
             $startWrite = microtime();
             $scanner->export();
             $this->status(true, implode(' ', ["Parse", count($scanner->getFiles()), 'files used', round(diff_milli($startParse), 4), 'ms,', 'total parsed', count($scanner->getClasses()), 'classes,', count($scanner->getNamespaces()), 'namespaces,', count($scanner->getFunctions()), 'functions,', "write all data", 'used', round(diff_milli($startWrite), 4), 'ms']));
         } catch (\Throwable $thrown) {
             $this->status(false, $thrown->getMessage() . "<br/>" . $thrown->getFile() . '#' . $thrown->getLine());
         }
     }
 }
Beispiel #2
0
 public function addIndex(string $scope, string $fullName)
 {
     if (!empty($fullName) && !isset($this->indexes[$fullName])) {
         $this->indexes[$fullName] = [DocMen::filterScope($scope), $fullName];
     }
     return $this;
 }
Beispiel #3
0
 protected function onConstruct()
 {
     $this->doc = DocMen::getInstance('docmen');
     parent::onConstruct();
     // TODO: Change the autogenerated stub
 }
Beispiel #4
0
use Ke\Utils\DocMen\DocMen;
global $app;
$docs = [new DocMen($app->path('doc/kephp2'), $app->kephp(), 'doc', function () {
    $this->setGenerable(false);
    $this->setTitle('kephp');
})];
$phpExcelSrc = 'D:\\xampp\\htdocs\\sk-917917\\917917.cc\\library\\PHPExcel';
if (is_dir($phpExcelSrc)) {
    $docs[] = new DocMen($app->path('doc/php_excel'), $phpExcelSrc, 'php_excel', function () {
        $this->setScannerOptions([\Ke\Utils\DocMen\SourceScanner::OPS_AUTO_IMPORT => false, \Ke\Utils\DocMen\SourceScanner::OPS_NS_STYLE => DocMen::NS_STYLE_OLD_PEAR]);
        require $this->source . '.php';
    });
}
$agimvcSrc = 'D:\\xampp\\htdocs\\sk-917917\\917917.cc\\library\\agimvc';
if (is_dir($agimvcSrc)) {
    $docs[] = new DocMen($app->path('doc/agimvc'), $agimvcSrc, 'agimvc', function () {
        $this->setGenerable(false);
        $this->setScannerOptions([\Ke\Utils\DocMen\SourceScanner::OPS_AUTO_IMPORT => false, \Ke\Utils\DocMen\SourceScanner::OPS_NS_STYLE => DocMen::NS_STYLE_MIXED, \Ke\Utils\DocMen\SourceScanner::OPS_NOT_PARSE_FILES => ['#bootstrap(_.*)?.php$#', '#\\\\agimvc[34]\\\\(.*)#', '#\\\\languages\\\\(.*)#', '#MongoCursor.php#']]);
        $this->setShowFile(false);
        $classes = import($this->source . '/classes_docmen.php');
        foreach ($classes as $class => $path) {
            $classes[$class] = $this->source . '/' . $path;
        }
        global $app;
        $app->getLoader()->setClassPaths($classes);
        import([$this->source . '/bootstrap_docmen.php', $this->source . '/MST/Core.php']);
        define('HTTP_BASE', '/');
    });
}
DocMen::register(...$docs);