芝麻web文件管理V1.00
编辑当前文件:/home/strato/chroot/opt/RZphp80/includes/CodeGen/PECL/Maintainer.php
* @copyright 2005-2008 Hartmut Holzgraefe * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version CVS: $Id: Maintainer.php,v 1.6 2006/10/09 21:27:04 hholzgra Exp $ * @link http://pear.php.net/package/CodeGen */ /** * includes */ require_once "CodeGen/Maintainer.php"; /** * PECL specific Maintainer extensions * * @category Tools and Utilities * @package CodeGen * @author Hartmut Holzgraefe
* @copyright 2005-2008 Hartmut Holzgraefe * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: @package_version@ * @link http://pear.php.net/package/CodeGen */ class CodeGen_PECL_Maintainer extends CodeGen_Maintainer { /** * Generate a phpinfo line for this author * * @access public * @return string phpinfo() line */ function phpinfoCode() { return "{$this->name} '{$this->email}' ({$this->role})"; } /** * Generate a package.xml
entry for this author * * @access public * @return string phpinfo() line */ function packageXml() { $code = "
\n"; $code.= "
{$this->user}
\n"; $code.= "
{$this->name}
\n"; $code.= "
{$this->email}
\n"; $code.= "
{$this->role}
\n"; $code.= "
\n"; return $code; } /** * Generate a package.xml 2.0
entry for this author * * @access public * @return string phpinfo() line */ function packageXml2() { $code = ""; $code.= " <{$this->role}>\n"; $code.= "
{$this->name}
\n"; $code.= "
{$this->user}
\n"; $code.= "
{$this->email}
\n"; $code.= "
yes
\n"; // TODO add something like this on the input side, too $code.= " {$this->role}>\n"; return $code; } /** * Comparison function * * We need to sort maintainers by role as package.xml 2.0 * requires this. This callback can be used by usort() to * sort an array of Maintainer objects * * @param object maintainer #1 * @param object maintainer #2 * @return int the usual -1, 0, 1 */ static function comp($m1, $m2) { $ranking = array("lead"=>1, "developer"=>2, "contributor"=>3, "helper"=>4); $r1 = $ranking[$m1->role]; $r2 = $ranking[$m2->role]; if ($r1 < $r2) return -1; if ($r1 > $r2) return 1; return 0; } } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * indent-tabs-mode:nil * End: */ ?>