phpDocumentor

         Rimpei Ogawa




   2009/6/29 -
• “Writing good documentation is essential
    to the success of any software project.”
    http://manual.phpdoc.org/HTMLS...
•
    ➡

•
    ➡   API
phpDocumentor
phpDocumentor
• Automatic Documentation System
phpDocumentor
• Automatic Documentation System
• for PHP code
phpDocumentor
• Automatic Documentation System
• for PHP code
• written in PHP
phpDocumentor
• Automatic Documentation System
• for PHP code
• written in PHP
PHP        PHP
API
• PEAR API Documentation
http://pear.php.net/package/Auth/docs/latest/
• Zend Framework
http://framework.zend.com/apidoc/c...
•             PEAR

    ‣ pear install PhpDocumentor
•
    •

    • DocBlock
DocBlock
DocBlock
/**
DocBlock
/**
 * Short description
 *
DocBlock
/**
 * Short description
 *
 * Long description. This is an sample function
 * to show the DocBlock format.
 *
 *...
DocBlock
/**
 * Short description
 *
 * Long description. This is an sample function
 * to show the DocBlock format.
 *
 *...
Short Description
• DocBlock
•
•3                   1


  Long Description
Long Description
•
            SGML

•

•         <p>
Long Description
• HTML
  • b, code, br, i, kbd, li, ol, p, pre, samp, ul, var
•             Short description
Long Description
•
/**
 * -   unordered item A
 * -   unordered item B
 *
 * 1   ordered item A
 * 2   ordered item B
 */
Long Description
•
    • <ul>   “-”, “+”, “#”, “o”

    • <ol>   “1”, “1.”

    •                             NG

    •
Tags
•@
 • @author @package @param @version
       30

• {@tagname}
@author
@author authorname <name@example.com>


•
•
@license
@license URL name of license


•                  URL

•
@license http://opensource.org/licenses/gpl-
license.php...
@deprecated
@deprecated version/info string


•

•
@deprecated deprecated since version 2.0

@deprecated
@package
•

•              DocBlock
    @package
@subpackage
•

•   @package
@param
 @param datatype $paramname description


•
• Type Hinting                PHP

•
 @param int $num

 @param bool|str...
@return
@return datatype description


•
•                                 PHP

•
@return mixed

@return FooClass|false Fo...
PHP


http://www.php.net/manual/ja/language.types.php
PHP5
•

    • @abstract
    • @access {private|protected|public}
    • @final
    • @static
DocBlock Template
•


•          DocBlock Template
DocBlock Template
/**#@+
 * @access private
 * @var string
 */
var $_var1 = ‘Hello’;
var $_var2 = ‘World’;
...
var $_varN;...
• phpdoc
•

 • HTML
   <meta>   OK
• -d :

• -t :
• -o :
•

    •   HTML -                Smarty

    •   CHM - Windows Help

    •   PDF - Adobe Acrobat

    •   XML:DocBook -
Web


http://www.phpdoc.org/
20090629 Using phpDocumentor
Upcoming SlideShare
Loading in...5
×

20090629 Using phpDocumentor

1,223

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,223
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
8
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

20090629 Using phpDocumentor

  1. 1. phpDocumentor Rimpei Ogawa 2009/6/29 -
  2. 2. • “Writing good documentation is essential to the success of any software project.” http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/ tutorial_phpDocumentor.pkg.html • OSS
  3. 3. • ➡ • ➡ API
  4. 4. phpDocumentor
  5. 5. phpDocumentor • Automatic Documentation System
  6. 6. phpDocumentor • Automatic Documentation System • for PHP code
  7. 7. phpDocumentor • Automatic Documentation System • for PHP code • written in PHP
  8. 8. phpDocumentor • Automatic Documentation System • for PHP code • written in PHP PHP PHP API
  9. 9. • PEAR API Documentation http://pear.php.net/package/Auth/docs/latest/ • Zend Framework http://framework.zend.com/apidoc/core/ • symfony http://www.symfony-project.org/api/1_2/
  10. 10. • PEAR ‣ pear install PhpDocumentor
  11. 11. • • • DocBlock
  12. 12. DocBlock
  13. 13. DocBlock /**
  14. 14. DocBlock /** * Short description *
  15. 15. DocBlock /** * Short description * * Long description. This is an sample function * to show the DocBlock format. * * 2nd paragraph of long description. *
  16. 16. DocBlock /** * Short description * * Long description. This is an sample function * to show the DocBlock format. * * 2nd paragraph of long description. * * @tag1 * @tag2 */ function example()
  17. 17. Short Description • DocBlock • •3 1 Long Description
  18. 18. Long Description • SGML • • <p>
  19. 19. Long Description • HTML • b, code, br, i, kbd, li, ol, p, pre, samp, ul, var • Short description
  20. 20. Long Description • /** * - unordered item A * - unordered item B * * 1 ordered item A * 2 ordered item B */
  21. 21. Long Description • • <ul> “-”, “+”, “#”, “o” • <ol> “1”, “1.” • NG •
  22. 22. Tags •@ • @author @package @param @version 30 • {@tagname}
  23. 23. @author @author authorname <name@example.com> • •
  24. 24. @license @license URL name of license • URL • @license http://opensource.org/licenses/gpl- license.php GNU Public License
  25. 25. @deprecated @deprecated version/info string • • @deprecated deprecated since version 2.0 @deprecated
  26. 26. @package • • DocBlock @package
  27. 27. @subpackage • • @package
  28. 28. @param @param datatype $paramname description • • Type Hinting PHP • @param int $num @param bool|string $foo a bool or string param
  29. 29. @return @return datatype description • • PHP • @return mixed @return FooClass|false FooClass object or error
  30. 30. PHP http://www.php.net/manual/ja/language.types.php
  31. 31. PHP5 • • @abstract • @access {private|protected|public} • @final • @static
  32. 32. DocBlock Template • • DocBlock Template
  33. 33. DocBlock Template /**#@+ * @access private * @var string */ var $_var1 = ‘Hello’; var $_var2 = ‘World’; ... var $_varN; /**#@-*/ // var $varX = array();
  34. 34. • phpdoc • • HTML <meta> OK
  35. 35. • -d : • -t : • -o :
  36. 36. • • HTML - Smarty • CHM - Windows Help • PDF - Adobe Acrobat • XML:DocBook -
  37. 37. Web http://www.phpdoc.org/
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×