cvs: pear /PEAR_PackageFileManager PackageFileManager.php
| From: | Laurent Laville | Date: | Mon, 06 Feb 2006 23:06:49 +0000 |
| Subject: | cvs: pear /PEAR_PackageFileManager PackageFileManager.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38026@lists.php.net to get a copy of this message | ||
farell Mon Feb 6 23:06:49 2006 UTC
Modified files:
/pear/PEAR_PackageFileManager PackageFileManager.php
Log:
- fixed Bug #5874 : Fails generation on missing "notes" element without error message.
- problem may occurs also with "package", "summary", "description",
"version", "state", "license" elements.
http://cvs.php.net/viewcvs.cgi/pear/PEAR_PackageFileManager/PackageFileManager.php?r1=1.51&r2=1.52&diff_format=u
Index: pear/PEAR_PackageFileManager/PackageFileManager.php
diff -u pear/PEAR_PackageFileManager/PackageFileManager.php:1.51
pear/PEAR_PackageFileManager/PackageFileManager.php:1.52
--- pear/PEAR_PackageFileManager/PackageFileManager.php:1.51 Tue Jan 17 14:04:26 2006
+++ pear/PEAR_PackageFileManager/PackageFileManager.php Mon Feb 6 23:06:48 2006
@@ -16,7 +16,7 @@
// | Web http://www.phpdoc.org
|
// | Mirror http://phpdocu.sourceforge.net/
|
// +------------------------------------------------------------------------+
-// $Id: PackageFileManager.php,v 1.51 2006/01/17 14:04:26 farell Exp $
+// $Id: PackageFileManager.php,v 1.52 2006/02/06 23:06:48 farell Exp $
//
/**
@@ -56,6 +56,8 @@
define('PEAR_PACKAGEFILEMANAGER_PHP_NOT_PACKAGE', 25);
define('PEAR_PACKAGEFILEMANAGER_CVS_PACKAGED', 26);
define('PEAR_PACKAGEFILEMANAGER_NO_PHPCOMPATINFO', 27);
+define('PEAR_PACKAGEFILEMANAGER_NONOTES', 28);
+define('PEAR_PACKAGEFILEMANAGER_NOLICENSE', 29);
/**#@-*/
/**
* Error messages
@@ -124,6 +126,10 @@
'path "%path%" contains CVS directory',
PEAR_PACKAGEFILEMANAGER_NO_PHPCOMPATINFO =>
'PHP_Compat is not installed, cannot detect dependencies',
+ PEAR_PACKAGEFILEMANAGER_NONOTES =>
+ 'Release Notes (option \'notes\') must be specified in
PEAR_PackageFileManager setOptions',
+ PEAR_PACKAGEFILEMANAGER_NOLICENSE =>
+ 'Release License (option \'license\') must be specified in
PEAR_PackageFileManager setOptions',
),
// other language translations go here
);
@@ -474,10 +480,10 @@
function setOptions($options = array(), $internal = false)
{
if (!$internal) {
- if (!isset($options['state'])) {
+ if (!isset($options['state']) || empty($options['state'])) {
return $this->raiseError(PEAR_PACKAGEFILEMANAGER_NOSTATE);
}
- if (!isset($options['version'])) {
+ if (!isset($options['version']) || empty($options['version'])) {
return $this->raiseError(PEAR_PACKAGEFILEMANAGER_NOVERSION);
}
}
@@ -930,6 +936,12 @@
if (!isset($this->_packageXml['maintainers']) ||
empty($this->_packageXml['maintainers'])) {
return $this->raiseError(PEAR_PACKAGEFILEMANAGER_ADD_MAINTAINERS);
}
+ if (!isset($this->_options['notes']) ||
empty($this->_options['notes'])) {
+ return $this->raiseError(PEAR_PACKAGEFILEMANAGER_NONOTES);
+ }
+ if (!isset($this->_options['license']) ||
empty($this->_options['license'])) {
+ return $this->raiseError(PEAR_PACKAGEFILEMANAGER_NOLICENSE);
+ }
extract($this->_options);
$date = date('Y-m-d');
if (isset($package)) {
@@ -1559,13 +1571,13 @@
function _generateNewPackageXML()
{
$this->_oldPackageXml = false;
- if (!isset($this->_options['package'])) {
+ if (!isset($this->_options['package']) ||
empty($this->_options['package'])) {
return $this->raiseError(PEAR_PACKAGEFILEMANAGER_NOPACKAGE);
}
- if (!isset($this->_options['summary'])) {
+ if (!isset($this->_options['summary']) ||
empty($this->_options['summary'])) {
return $this->raiseError(PEAR_PACKAGEFILEMANAGER_NOSUMMARY);
}
- if (!isset($this->_options['description'])) {
+ if (!isset($this->_options['description']) ||
empty($this->_options['description'])) {
return $this->raiseError(PEAR_PACKAGEFILEMANAGER_NODESC);
}
$this->_packageXml = array();