什么是phpDocumentor第2/2页

 更新时间:2008年09月25日 09:17:35   作者:  
PHPDocumentor是一个用PHP写的工具,对于有规范注释的php程序,它能够快速生成具有相互参照,索引等功能的API文档。

7. 总结
phpDocumentor是一个非常强大的文档自动生成工具,利用它可以帮助我们编写规范的注释,生成易于理解,结构清晰的文档,对我们的代码升级,维护,移交等都有非常大的帮助。
关于phpDocumentor更为详细的说明,可以到它的官方网站
http://manual.phpdoc.org/查阅

8.附录
附录1:
能够被phpdoc识别的关键字:

Include
Require
include_once
require_once
define
function
global
class

附录2
文档中可以使用的标签
<b>
<code>
<br>
<kdb>
<li>
<pre>
<ul>
<samp>
<var>

附录三:
一段含有规范注释的php代码
<?php
/**
* Sample File 2, phpDocumentor Quickstart
*
* This file demonstrates the rich information that can be included in
* in-code documentation through DocBlocks and tags.
* @author Greg Beaver <cellog@php.net>
* @version 1.0
* @package sample
*/
// sample file #1
/**
* Dummy include value, to demonstrate the parsing power of phpDocumentor
*/
include_once 'sample3.php';

/**
* Special global variable declaration DocBlock
* @global integer $GLOBALS['_myvar']
* @name $_myvar
*/
$GLOBALS['_myvar'] = 6;

/**
* Constants
*/
/**
* first constant
*/
define('testing', 6);
/**
* second constant
*/
define('anotherconstant', strlen('hello'));

/**
* A sample function docblock
* @global string document the fact that this function uses $_myvar
* @staticvar integer $staticvar this is actually what is returned
* @param string $param1 name to declare
* @param string $param2 value of the name
* @return integer
*/
function firstFunc($param1, $param2 = 'optional')
{
static $staticvar = 7;
global $_myvar;
return $staticvar;
}

/**
* The first example class, this is in the same package as the
* procedural stuff in the start of the file
* @package sample
* @subpackage classes
*/
class myclass {
/**
* A sample private variable, this can be hidden with the --parseprivate
* option
* @access private
* @var integer|string
*/
var $firstvar = 6;
/**
* @link http://www.example.com Example link
* @see myclass()
* @uses testing, anotherconstant
* @var array
*/
var $secondvar =
array(
'stuff' =>
array(
6,
17,
'armadillo'
),
testing => anotherconstant
);

/**
* Constructor sets up {@link $firstvar}
*/
function myclass()
{
$this->firstvar = 7;
}

/**
* Return a thingie based on $paramie
* @param boolean $paramie
* @return integer|babyclass
*/
function parentfunc($paramie)
{
if ($paramie) {
return 6;
} else {
return new babyclass;
}
}
}

/**
* @package sample1
*/
class babyclass extends myclass {
/**
* The answer to Life, the Universe and Everything
* @var integer
*/
var $secondvar = 42;
/**
* Configuration values
* @var array
*/
var $thirdvar;

/**
* Calls parent constructor, then increments {@link $firstvar}
*/
function babyclass()
{
parent::myclass();
$this->firstvar++;
}

/**
* This always returns a myclass
* @param ignored $paramie
* @return myclass
*/
function parentfunc($paramie)
{
return new myclass;
}
}
?>

相关文章

  • php中并发读写文件冲突的解决方案

    php中并发读写文件冲突的解决方案

    在这里提供4种高并发读写文件的方案,各有优点,可以根据自己的情况解决php并发读写文件冲突的问题。
    2013-10-10
  • 什么是phpDocumentor

    什么是phpDocumentor

    PHPDocumentor是一个用PHP写的工具,对于有规范注释的php程序,它能够快速生成具有相互参照,索引等功能的API文档。
    2008-09-09
  • PHP程序员面试 切忌急功近利(更需要注重以后的发展)

    PHP程序员面试 切忌急功近利(更需要注重以后的发展)

    招聘一个程序员,唯一对你有意义的是他能写出好程序的能力。 很少人像这样去招人,他们更喜欢去挑剔程序员的个人癖好和性格缺点。
    2010-09-09
  • DedeCms模板安装/制作概述

    DedeCms模板安装/制作概述

    DedeCms模板安装/制作概述...
    2007-03-03
  • WINXP下apache+php4+mysql

    WINXP下apache+php4+mysql

    WINXP下apache+php4+mysql...
    2006-11-11
  • 抛弃 PHP 代价太高

    抛弃 PHP 代价太高

    有效率地在AWS上部署是值得学习的但是怎样简单的去部署git服务?为了它我是否需要额外的服务?同样的一个实例是否可以运行多个应用?收费模型又是怎么样的呢尽管看了他们的价格页面,我还是不明白哪一部分跟我相关。看完他们网站我心里还是有一堆的问号无法找到答复。
    2016-04-04
  • PHP 开发工具

    PHP 开发工具

    PHP 开发工具...
    2006-12-12
  • PHP如何解决网站大流量与高并发的问题

    PHP如何解决网站大流量与高并发的问题

    普通的P4服务器一般最多能支持每天10万独立IP,如果访问量比这个还要大,那么必须首先配置一台更高性能的专用服务器才能解决问题
    2011-06-06
  • PHP 已经成熟

    PHP 已经成熟

    这篇文章主要介绍了PHP 已经成熟
    2006-12-12
  • php程序员应具有的7种能力小结

    php程序员应具有的7种能力小结

    php程序员应具有什么样的能力,才能更好的完成工作,才会有更好的发展方向呢?在中国我想您不会写一辈子代码的,那样不可能,过了黄金期,您又怎么办呢?看了本文后,希望对您有所帮助
    2014-11-11

最新评论