0

I'm trying to automate documentation building in our team development environmen, so we decided to use phpDocumentor(2.7.0) and to trigger it to rebuild documentation on SVN post-commit.

I have made a trigger, but I'm pretty shure that all documentation is rebuild every time it is executed, because even if I only commit one modified file, the phpdoc command lasts almost the same time like when documentation initial build.

So my idea was to rebuild only documentation of those files, changed in the commit. Is there some possibility to do so ? I have looked into the documentation of phpDoc and Google, but nothing found.

dmikam
  • 992
  • 1
  • 18
  • 27

2 Answers2

2

As long as your last phpDocumentor2 execution's result files are in the same place you're about to run the new execution, by default only new/modified files should be getting processed. phpDocumentor2 has a built-in caching mechanism to track "here's everything we did in the last doc run", so that it can determine what code files of yours have been added/changed.

Of course, if your build is running fresh each time, that cache from the previous run is not available, and thus all phpDocumentor2 knows is "this is the first execution ever".

ashnazg
  • 6,558
  • 2
  • 32
  • 39
  • I thought it was so, and it looks like it is so when I use "responsive" theme, but when I choose the "clean" theme, every build take a lot of time, just like (or close to) the first time run. – dmikam Sep 19 '14 at 09:08
  • I'll accept this answer, because it look's like it is the 'clean' theme issue, but with default "responsive" theme the caching mecanism is working well. – dmikam Sep 30 '14 at 08:38
0

You can get list of files, affected by revision, using svnlook changed. If you can use single file as parameter, you can pipe only needed file(s) to PHPDoc

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • Thanks for reply. I know about svnlook changed and I tryed to pass these files to `phpdoc -f file1,file2,file2 -t /path/to/my/doc/` But it looks like when I do so, the documentation is rebuilt removing information about all other files. I mean, for example, at first I build full documentation using `phpdoc -d /my/source -t /path/to/my/doc` After that I can see documentation in all my files Then, when I do `phpdoc -d /my/source/file1,/my/source/file2 -t /path/to/my/doc` All doc is removed and only file1 and file2 is documented. – dmikam Sep 16 '14 at 08:20
  • @dmikam - build *files* in temporary dir, move to real destination by overwriting older? – Lazy Badger Sep 16 '14 at 13:09
  • impossible, as new created files will overwrite an existent ones, overwriting a sidebar menu with its list of classes, functions etc. Also it would overwrite a class hierarchy diagram. – dmikam Sep 17 '14 at 07:15