@@ -207,14 +207,14 @@ private function struct($node, $reset=FALSE, $parent=array())
207207 $ this ->struct ($ subNode , FALSE , array ('namespace ' => $ name ));
208208 }
209209 } elseif ($ node instanceof PHPParser_Node_Expr_Assign) {
210- if (is_string ($ node ->var ->name )) {
210+ if (isset ( $ node -> var -> name ) && is_string ($ node ->var ->name )) {
211211 $ kind = 'v ' ;
212212 $ node = $ node ->var ;
213213 $ name = $ node ->name ;
214214 $ line = $ node ->getLine ();
215215 }
216216 } elseif ($ node instanceof PHPParser_Node_Expr_AssignRef) {
217- if (is_string ($ node ->var ->name )) {
217+ if (isset ( $ node -> var -> name ) && is_string ($ node ->var ->name )) {
218218 $ kind = 'v ' ;
219219 $ node = $ node ->var ;
220220 $ name = $ node ->name ;
@@ -389,7 +389,7 @@ private function full_render() {
389389 // Save all tag information to a file for faster updates if a cache file was specified.
390390 if (isset ($ this ->cachefile )) {
391391 file_put_contents ($ this ->cachefile , serialize ($ this ->tagdata ));
392- if ($ this ->mOptions ['v ' ]) {
392+ if ($ this ->mOptions ['V ' ]) {
393393 echo "Saved cache file. " .PHP_EOL ;
394394 }
395395 }
@@ -416,7 +416,7 @@ public function export()
416416 $ end = microtime (true );
417417
418418 if ($ this ->mOptions ['V ' ]) {
419- echo "It tooks " .($ end -$ start )." seconds. " .PHP_EOL ;
419+ echo PHP_EOL . "It took " .($ end -$ start )." seconds. " .PHP_EOL ;
420420 }
421421
422422 return $ content ;
@@ -426,7 +426,7 @@ private function process($file)
426426 {
427427 // Load the tag md5 data to skip unchanged files.
428428 if (!isset ($ this ->tagdata ) && isset ($ this ->cachefile ) && file_exists (realpath ($ this ->cachefile ))) {
429- if ($ this ->mOptions ['v ' ]) {
429+ if ($ this ->mOptions ['V ' ]) {
430430 echo "Loaded cache file. " .PHP_EOL ;
431431 }
432432 $ this ->tagdata = unserialize (file_get_contents (realpath ($ this ->cachefile )));
@@ -469,10 +469,11 @@ private function process($file)
469469
470470 private function process_single_file ($ filename )
471471 {
472- if ($ this ->mOptions ['v ' ] && $ this ->filecount > 1 && $ this ->filecount % 64 == 0 ) {
472+ if ($ this ->mOptions ['V ' ] && $ this ->filecount > 1 && $ this ->filecount % 64 == 0 ) {
473473 echo " " .$ this ->filecount ." files " .PHP_EOL ;
474474 }
475475 $ this ->filecount ++;
476+ $ startfile = microtime (true );
476477
477478 $ this ->setMFile ((string ) $ filename );
478479 $ file = file_get_contents ($ this ->mFile );
@@ -487,12 +488,14 @@ private function process_single_file($filename)
487488 }
488489
489490 $ struct = $ this ->struct ($ this ->mParser ->parse ($ file ), TRUE );
491+ $ finishfile = microtime (true );
490492 $ this ->mLines [$ this ->mFile ] = $ this ->render ($ struct );
493+ $ finishmerge = microtime (true );
491494 $ this ->tagdata [$ this ->mFile ][$ md5 ] = $ this ->mLines [$ this ->mFile ];
492495 if ($ this ->mOptions ['debug ' ]) {
493496 echo "Parse: " .($ finishfile - $ startfile ).", Merge: " .($ finishmerge -$ finishfile )."; ( " .$ this ->filecount .") " .$ this ->mFile .PHP_EOL ;
494- } else if ($ this ->mOptions ['v ' ]) {
495- echo "U " ;
497+ } else if ($ this ->mOptions ['V ' ]) {
498+ echo ". " ;
496499 }
497500 }
498501
0 commit comments