E_ALL fixes

This commit is contained in:
Tomas V.V.Cox 2001-11-06 00:22:18 +00:00
parent 962216c201
commit 16f8af514f
2 changed files with 18 additions and 17 deletions

View File

@ -147,7 +147,8 @@ class PEAR_Common extends PEAR
{ {
array_push($this->element_stack, $name); array_push($this->element_stack, $name);
$this->current_element = $name; $this->current_element = $name;
$this->prev_element = $this->element_stack[sizeof($this->element_stack)-2]; $spos = sizeof($this->element_stack) - 2;
$this->prev_element = ($spos >= 0) ? $this->element_stack[$spos] : '';
$this->current_attributes = $attribs; $this->current_attributes = $attribs;
switch ($name) { switch ($name) {
case 'dir': case 'dir':
@ -253,7 +254,8 @@ class PEAR_Common extends PEAR
$this->in_changelog = false; $this->in_changelog = false;
} }
array_pop($this->element_stack); array_pop($this->element_stack);
$this->current_element = $this->element_stack[sizeof($this->element_stack)-1]; $spos = sizeof($this->element_stack) - 1;
$this->current_element = ($spos > 0) ? $this->element_stack[$spos] : '';
} }
// }}} // }}}
@ -265,48 +267,48 @@ class PEAR_Common extends PEAR
case 'name': case 'name':
switch ($this->prev_element) { switch ($this->prev_element) {
case 'package': case 'package':
$this->pkginfo['package'] .= $data; $this->pkginfo['package'] = $data;
break; break;
case 'maintainer': case 'maintainer':
$this->current_maintainer['name'] .= $data; $this->current_maintainer['name'] = $data;
break; break;
} }
break; break;
case 'summary': case 'summary':
$this->pkginfo['summary'] .= $data; $this->pkginfo['summary'] = $data;
break; break;
case 'user': case 'user':
$this->current_maintainer['handle'] .= $data; $this->current_maintainer['handle'] = $data;
break; break;
case 'email': case 'email':
$this->current_maintainer['email'] .= $data; $this->current_maintainer['email'] = $data;
break; break;
case 'role': case 'role':
if (!in_array($data, $this->maintainer_roles)) { if (!in_array($data, $this->maintainer_roles)) {
trigger_error("The maintainer role: '$data' is not valid", E_USER_WARNING); trigger_error("The maintainer role: '$data' is not valid", E_USER_WARNING);
} else { } else {
$this->current_maintainer['role'] .= $data; $this->current_maintainer['role'] = $data;
} }
break; break;
case 'version': case 'version':
if ($this->in_changelog) { if ($this->in_changelog) {
$this->current_release['version'] .= $data; $this->current_release['version'] = $data;
} else { } else {
$this->pkginfo['version'] .= $data; $this->pkginfo['version'] = $data;
} }
break; break;
case 'date': case 'date':
if ($this->in_changelog) { if ($this->in_changelog) {
$this->current_release['release_date'] .= $data; $this->current_release['release_date'] = $data;
} else { } else {
$this->pkginfo['release_date'] .= $data; $this->pkginfo['release_date'] = $data;
} }
break; break;
case 'notes': case 'notes':
if ($this->in_changelog) { if ($this->in_changelog) {
$this->current_release['release_notes'] .= $data; $this->current_release['release_notes'] = $data;
} else { } else {
$this->pkginfo['release_notes'] .= $data; $this->pkginfo['release_notes'] = $data;
} }
break; break;
case 'state': case 'state':
@ -315,13 +317,12 @@ class PEAR_Common extends PEAR
} elseif ($this->in_changelog) { } elseif ($this->in_changelog) {
$this->current_release['release_state'] = $data; $this->current_release['release_state'] = $data;
} else { } else {
$this->pkginfo['release_state'] .= $data; $this->pkginfo['release_state'] = $data;
} }
break; break;
case 'dir': case 'dir':
break; break;
case 'file': case 'file':
$role = strtolower($this->current_attributes['role']);
$this->current_file = trim($data); $this->current_file = trim($data);
break; break;
case 'libname': case 'libname':

View File

@ -114,7 +114,7 @@ class PEAR_Packager extends PEAR_Common
} }
$pwd = getcwd(); $pwd = getcwd();
$pkgfile = basename($pkgfile); $pkgfile = basename($pkgfile);
if ($pkginfo['release_state'] == 'snapshot') { if (isset($pkginfo['release_state']) && $pkginfo['release_state'] == 'snapshot') {
$pkginfo['version'] = date('Ymd'); $pkginfo['version'] = date('Ymd');
} }
// don't want strange characters // don't want strange characters