PHPDoc documentation generator in or out of Eclipse?
Solution 1
To generate the documentation, you should use phpDocumentor, which can be installed as a PEAR package.
Then, you have to call it from command-line ; I've never seen it called from Eclipse PDT, actually.
A great solution is to have a continuous-integration platform (using phpUnderControl, for instance), and integrate to creation of the phpdoc in your build configuration file ; this way, the phpdoc is generated everytime someone commits (or once a day, or whenever you want ^^ ).
In Eclipse PDT, you can call "external tools" (see "Run > External Tools" in the menu) ; this would allow you to launch the phpdoc command (like you do from CLI) ; but it definitly is not as user-friendly as what Zend Studio offers -- not the same price either, though ^^
Solution 2
Another great tool to generate documentation is ApiGen. It doesn't need installation with PEAR (but includes it) and it can be used like a standalone package.
Solution 3
Yes there is a wizard to do this in Zend. Check out this brief guide.
Alternatively you can create an external launch configuration to invoke the standard phpDocumentor.
- Select Run->External Tools->External Tools Configurations...
- In the left hand pane, select Program then the new icon (left-most icon above the pane).
- In the right hand pane, select the Main tab.
- Enter generate_doc in the Name: field.
- Enter the path to the phpdoc cli tool in the Location: field.
- Enter any required arguments in the Arguments field, e.g. for the current project input ${project_loc}.
- To run the external configuration, select Run.
To rerun the configuration you have a few choices:
- Select the External Tools icon from the menu bar external tools icon http://help.eclipse.org/ganymede/topic/org.eclipse.cdt.doc.user/images/icon%5Fext%5Ftools.png" then click generate_doc
- Select Run->External Tools->generate_doc
- Hit Alt+R, E, 1 (assuming generate_doc is the first item in the list, otherwise pick the appropriate number)
AlexA
Freelance Python developer. Data engineer. LinkedIn Profile: https://www.linkedin.com/in/alexey-a-181a614/ AWS Certified Solutions Architect associate Tools: Django, Python, AWS, Celery, mysql, Postgresql, jquery, Backbone.js
Updated on July 20, 2022Comments
-
AlexA almost 2 years
I am developing with Eclipse + PDT. I've been adding phpdoc comments into my code, but actually never generated a resulting documentation in Eclipse. How should I do it - is there some functionality in Eclipse, or doc generation should be done externally?
-
AlexA almost 15 yearsThanks, but I am using regular Eclipse + PDT, apparently there is no such an option.
-
Lance Rushing over 14 yearsI've used ant to build my php projects, and usually have a doc target. Eclipse plays very nice with ant. Also you run phing from eclipse.
-
Suhail Gupta over 8 yearsHow do we install
ApiGen
for windows? I downloaded thephar
package but have no clue as how to proceed. -
Davide Pastore over 8 years@SuhailGupta take a look here: github.com/ApiGen/ApiGen
-
Suhail Gupta over 8 yearsSo I included the path
C:\wamp\www\apigen.phar
into user variablePATH
and also inside theSystem
Path. But it doesn't work! Just prints nothing. -
Davide Pastore over 8 yearsTry to open an issue here: github.com/ApiGen/ApiGen/issues
-
Suhail Gupta over 8 yearsI typed the command as
php apigen generate --help
and the output isCould not open input file: apigen
-
Davide Pastore over 8 yearsTry with apigen.phar
-
Suhail Gupta over 8 yearsSame
Could not open input file: apigen.phar