1. #1
    Sencha User steffenbrem's Avatar
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    2
    steffenbrem is on a distinguished road

      0  

    Default 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:

    Code:
    <?php
    /**
     * @class MyClass
     */
    class MyClass
    {
        /**
         * Test method
         * @method
         */
        public function method()
        {
         
        }
    }
    When I want to generate docs for this PHP class, it throws the following error:

    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

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Location
    Oklahoma, USA
    Posts
    52
    Vote Rating
    8
    Answers
    10
    sdt6585 will become famous soon enough

      0  

    Default


    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.

  3. #3
    Sencha User steffenbrem's Avatar
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    2
    steffenbrem is on a distinguished road

      0  

    Default


    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.

  4. #4
    Sencha User
    Join Date
    Mar 2012
    Location
    Oklahoma, USA
    Posts
    52
    Vote Rating
    8
    Answers
    10
    sdt6585 will become famous soon enough

      1  

    Default


    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.

  5. #5
    Sencha User steffenbrem's Avatar
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    2
    steffenbrem is on a distinguished road

      0  

    Default


    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!

  6. #6
    Sencha - Services Team
    Join Date
    Mar 2007
    Location
    Foristell, MO
    Posts
    1,108
    Vote Rating
    3
    Answers
    12
    jratcliff is on a distinguished road

      0  

    Default


    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

  7. #7
    Sencha User steffenbrem's Avatar
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    2
    steffenbrem is on a distinguished road

      0  

    Default


    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

  8. #8
    Sencha User steffenbrem's Avatar
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    2
    steffenbrem is on a distinguished road

      0  

    Default


    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):
    Code:
    sudo gem install jsduck -v 3.11.2
    Now i just go to my project folder with the PHP source files and use: jsduck -o docs ./src/*.php

    Thanks for all the help!

Thread Participants: 2

Tags for this Thread