什么是phpDocumentor
更新時(shí)間:2008年09月25日 09:17:35 作者:
PHPDocumentor是一個(gè)用PHP寫(xiě)的工具,對(duì)于有規(guī)范注釋的php程序,它能夠快速生成具有相互參照,索引等功能的API文檔。
7. 總結(jié)
phpDocumentor是一個(gè)非常強(qiáng)大的文檔自動(dòng)生成工具,利用它可以幫助我們編寫(xiě)規(guī)范的注釋?zhuān)梢子诶斫?,結(jié)構(gòu)清晰的文檔,對(duì)我們的代碼升級(jí),維護(hù),移交等都有非常大的幫助。
關(guān)于phpDocumentor更為詳細(xì)的說(shuō)明,可以到它的官方網(wǎng)站
http://manual.phpdoc.org/查閱
8.附錄
附錄1:
能夠被phpdoc識(shí)別的關(guān)鍵字:
Include
Require
include_once
require_once
define
function
global
class
附錄2
文檔中可以使用的標(biāo)簽
<b>
<code>
<br>
<kdb>
<li>
<pre>
<ul>
<samp>
<var>
附錄三:
一段含有規(guī)范注釋的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;
}
}
?>
相關(guān)文章
ADODB的數(shù)據(jù)庫(kù)封包程序庫(kù)
ADODB的數(shù)據(jù)庫(kù)封包程序庫(kù)...2006-12-12
對(duì)PHP語(yǔ)言認(rèn)識(shí)上需要避免的10大誤區(qū)
PHP是一種非常流行的開(kāi)源服務(wù)器端腳本語(yǔ)言,你在萬(wàn)維網(wǎng)看到的大多數(shù)網(wǎng)站都是使用php開(kāi)發(fā)的。很多人不用php并不是因?yàn)橐恍┍蛔C實(shí)的語(yǔ)言缺點(diǎn)。他們決定不用php,是因?yàn)檎`解。2014-06-06
特轉(zhuǎn)載一高手總結(jié)PHP學(xué)習(xí)資源和鏈接.
特轉(zhuǎn)載一高手總結(jié)PHP學(xué)習(xí)資源和鏈接....2006-12-12
php教程 插件機(jī)制在PHP中實(shí)現(xiàn)方案
PHP中插件機(jī)制的一種實(shí)現(xiàn)方案. 這篇文章的出發(fā)點(diǎn)是我對(duì)插件機(jī)制的理解,及其在PHP中的實(shí)現(xiàn)。此方案僅是插件機(jī)制在PHP中的2012-11-11
smarty+adodb+部分自定義類(lèi)的php開(kāi)發(fā)模式
smarty+adodb+部分自定義類(lèi)的php開(kāi)發(fā)模式...2006-12-12
dedecms系統(tǒng)常用術(shù)語(yǔ)匯總
dedecms系統(tǒng)常用術(shù)語(yǔ)匯總...2007-04-04

