Ejemplo n.º 1
0
 protected function onExecute($argv = null)
 {
     $startParse = microtime();
     $this->scanner->start();
     $this->console->println("Parse", count($this->scanner->getFiles()), 'files used', round(diff_milli($startParse), 4), 'ms,', 'total parsed', count($this->scanner->getClasses()), 'classes,', count($this->scanner->getNamespaces()), 'namespaces,', count($this->scanner->getFunctions()), 'functions');
     $startWrite = microtime();
     $this->scanner->export();
     $this->console->println("Write all data", 'used', round(diff_milli($startWrite), 4), 'ms');
 }
Ejemplo n.º 2
0
 protected function onExecute($argv = null)
 {
     $start = microtime();
     $total = 0;
     foreach ($this->tables as $table) {
         $class = $this->parseTableNameInGroup($table['name']);
         $command = new NewModel(['', $class]);
         if (is_file($command->getPath())) {
             $command = new UpdateModel(['', $class]);
         }
         $command->execute();
         $total++;
     }
     $usedTime = round(diff_milli($start), 4);
     $this->console->println("There are {$total} model create or update, used {$usedTime} ms!");
 }
Ejemplo n.º 3
0
 protected function onExecute($argv = null)
 {
     $start = microtime();
     $root = $this->git->getRoot();
     $dir = $this->getExportDir($this->version);
     $files = $this->git->getChangeFiles($this->version);
     $total = 0;
     foreach ($files as $file) {
         $path = real_path("{$root}/{$file}");
         if ($path && $this->copy($path, "{$dir}/{$file}")) {
             $this->console->println("exporting file {$file} ...");
             $total++;
         }
     }
     $usedTime = round(diff_milli($start), 4);
     $this->console->println("There are {$total} files export to \"{$dir}\", used {$usedTime} ms!");
 }
Ejemplo n.º 4
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());
         }
     }
 }