PEAR 程式撰寫標準-標頭註解區

日期 2010年08月15日 15:37:46 | 新聞類別: 模組開發

原始出處 http://www.xoops.org/modules/mediawiki/index.php/Dev:coding_standards


 

在所有的核心PEAR 程式碼都會有像是接下來的註解作為標頭:

<?php
// $Id: filename.php,v x.xx 2004/xx/xx 00:00:00 developername Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                  Copyright (c) 2000-2004 XOOPS.org                        //
//                       <http://www.xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
?>

目前沒有硬性規定什麼時後提供新程式碼的人應該被列入程式檔案的作者列表內。一般而言,他們的改變應該屬於"重大"類別(意思是大概10%到20%程式碼的改變)。重寫函式或是提供新邏輯者除外。

程式碼重新整理或是錯誤修正不是提供新程式碼所以不可以被列入作者列表內。

不是核心PEAR 儲存所的檔案也應該要有個類似的版權、版本,與作者宣告。所有的檔案應該保持模式性的一致以保持一致性。





本篇新聞來自:XOOPS Site
https://www.xoops.org.tw

本篇新聞的連結網址是:
https://www.xoops.org.tw/modules/news/article.php?storyid=36