-
29 Oct 2012 3:22 AM #1
Unanswered: Using JSDuck for documenting PHP classes
Unanswered: Using JSDuck for documenting PHP classes
Hello,
I've tried JSDuck and it's a great documenting tool! But only for Javascript. I have a Ext App, with a big PHP back-end. Because multiple developers will get involved, I need to create documentation for the PHP-backend + the Ext JS app.
Documenting the Ext JS app is no problem, I can generate it in JSDuck with no problems. But when I want to document a simple PHP file:
When I want to generate docs for this PHP class, it throws the following error:Code:<?php /** * @class MyClass */ class MyClass { /** * Test method * @method */ public function method() { } }
Code:Error: Error while parsing /Applications/XAMPP/xamppfiles/htdocs/jsduck_php_test/Class.php: Line 1: Unexpected token <
Is there some trick to suppress those errors or to support the PHP syntax? I really hope somebody could help me out here!
Steffen
-
29 Oct 2012 4:11 AM #2
You might want to check out something like this: http://www.phpdoc.org/ for documenting PHP. The regular expressions used in JSDuck to parse javascript will likely continue to cause problems when applied to PHP code given the differences in syntax.
-
29 Oct 2012 5:10 AM #3
I've heard that sombody from the Sencha Support Team got it working with JAVA, PHP and Ruby. So I guess it is possible to render a JSDuck documentation from a PHP class.
PHPDoc is not really an option, since it doesn't fill the needs of a good documentation.
-
29 Oct 2012 5:18 AM #4
You might send jratcliff a pm and ask him to come comment then. It seems he got it to work from this forum post:
http://www.sencha.com/forum/showthre...l=1#post778165
Good Luck.
-
29 Oct 2012 5:55 AM #5
I've send him a private message, I hope he can help me with this. If I got the answer, I will post it here.
Thanks for your help!
-
29 Oct 2012 5:28 PM #6Sencha - Services Team
- Join Date
- Mar 2007
- Location
- Foristell, MO
- Posts
- 1,100
- Vote Rating
- 3
- Answers
- 12
What version of JSDuck are you using? I was using 3.5 when I was creating docs for PHP and Ruby. Starting with 4.0 there was a JavaScript parser added and so I'm not even sure if this is now doable with this version. Try a 3.x version to see if it will work. In the meantime, I'll see what is possible with 4.x.
Jack Ratcliff
Sencha Inc, Green bleeding Senchan
How to report a bug:
http://www.sencha.com/forum/showthre...o-report-a-bug
-
30 Oct 2012 12:02 AM #7
Hello,
Thanks for your answer! I am using the latest version at the moment (JSDuck 4.3.2). I will give version 3.5 a try, it would be nice if it worked in the newer versions too though
Thanks to all!
Steffen
-
30 Oct 2012 12:44 AM #8
Well! I actually got it working now with version 3.11.2! It renders the documentation nicely without problems

I used the following command to install jsduck 3.11.2 (Max OSX):
Now i just go to my project folder with the PHP source files and use: jsduck -o docs ./src/*.phpCode:sudo gem install jsduck -v 3.11.2
Thanks for all the help!


Reply With Quote