$this->prev_element = $this->element_stack[sizeof($this->element_stack)-2];
$this->current_attributes = $attribs;
switch ($name) {
- case 'Dir':
+ case 'DIR':
if (isset($this->dir_names)) {
- $this->dir_names[] = $attribs['Name'];
+ $this->dir_names[] = $attribs['NAME'];
} else {
// Don't add the root dir
$this->dir_names = array();
}
- if (isset($attribs['BaseInstallDir'])) {
- $this->dir_install = $attribs['BaseInstallDir'];
+ if (isset($attribs['BASEINSTALLDIR'])) {
+ $this->dir_install = $attribs['BASEINSTALLDIR'];
}
- if (isset($attribs['Role'])) {
- $this->dir_role = $attribs['Role'];
+ if (isset($attribs['ROLE'])) {
+ $this->dir_role = $attribs['ROLE'];
}
break;
- case 'LibFile':
+ case 'LIBFILE':
$this->lib_atts = $attribs;
- $this->lib_atts['Role'] = 'extension';
+ $this->lib_atts['ROLE'] = 'extension';
break;
- case 'Maintainers':
+ case 'MAINTAINERS':
$this->pkginfo['maintainers'] = array();
$this->m_i = 0; // maintainers array index
break;
- case 'Maintainer':
+ case 'MAINTAINER':
// compatibility check
if (!isset($this->pkginfo['maintainers'])) {
$this->pkginfo['maintainers'] = array();
$this->pkginfo['maintainers'][$this->m_i] = array();
$this->current_maintainer =& $this->pkginfo['maintainers'][$this->m_i];
break;
- case 'Changelog':
+ case 'CHANGELOG':
$this->pkginfo['changelog'] = array();
$this->c_i = 0; // changelog array index
$this->in_changelog = true;
break;
- case 'Release':
+ case 'RELEASE':
if ($this->in_changelog) {
$this->pkginfo['changelog'][$this->c_i] = array();
$this->current_release =& $this->pkginfo['changelog'][$this->c_i];
function _element_end($xp, $name)
{
switch ($name) {
- case 'Dir':
+ case 'DIR':
array_pop($this->dir_names);
unset($this->dir_install);
unset($this->dir_role);
break;
- case 'File':
+ case 'FILE':
$path = '';
foreach ($this->dir_names as $dir) {
$path .= $dir . DIRECTORY_SEPARATOR;
$path .= $this->current_file;
$this->filelist[$path] = $this->current_attributes;
// Set the baseinstalldir only if the file don't have this attrib
- if (!isset($this->filelist[$path]['BaseInstallDir']) &&
+ if (!isset($this->filelist[$path]['BASEINSTALLDIR']) &&
isset($this->dir_install))
{
- $this->filelist[$path]['BaseInstallDir'] = $this->dir_install;
+ $this->filelist[$path]['BASEINSTALLDIR'] = $this->dir_install;
}
// Set the Role
- if (!isset($this->filelist[$path]['Role']) && isset($this->dir_role)) {
- $this->filelist[$path]['Role'] = $this->dir_role;
+ if (!isset($this->filelist[$path]['ROLE']) && isset($this->dir_role)) {
+ $this->filelist[$path]['ROLE'] = $this->dir_role;
}
break;
- case 'LibFile':
+ case 'LIBFILE':
$path = '';
foreach ($this->dir_names as $dir) {
$path .= $dir . DIRECTORY_SEPARATOR;
$path .= $this->lib_name;
$this->filelist[$path] = $this->lib_atts;
// Set the baseinstalldir only if the file don't have this attrib
- if (!isset($this->filelist[$path]['BaseInstallDir']) &&
+ if (!isset($this->filelist[$path]['BASEINSTALLDIR']) &&
isset($this->dir_install))
{
- $this->filelist[$path]['BaseInstallDir'] = $this->dir_install;
+ $this->filelist[$path]['BASEINSTALLDIR'] = $this->dir_install;
}
if (isset($this->lib_sources)) {
$this->filelist[$path]['sources'] = $this->lib_sources;
unset($this->lib_atts);
unset($this->lib_sources);
break;
- case 'Maintainer':
+ case 'MAINTAINER':
$this->m_i++;
break;
- case 'Release':
+ case 'RELEASE':
if ($this->in_changelog) {
$this->c_i++;
}
break;
- case 'Changelog':
+ case 'CHANGELOG':
$this->in_changelog = false;
}
array_pop($this->element_stack);
function _pkginfo_cdata($xp, $data)
{
switch ($this->current_element) {
- case 'Name':
+ case 'NAME':
switch ($this->prev_element) {
- case 'Package':
+ case 'PACKAGE':
$this->pkginfo['package'] .= $data;
break;
- case 'Maintainer':
+ case 'MAINTAINER':
$this->current_maintainer['name'] .= $data;
break;
}
break;
- case 'Summary':
+ case 'SUMMARY':
$this->pkginfo['summary'] .= $data;
break;
- case 'Initials':
+ case 'INITIALS':
$this->current_maintainer['handle'] .= $data;
break;
- case 'Email':
+ case 'EMAIL':
$this->current_maintainer['email'] .= $data;
break;
- case 'Role':
+ case 'ROLE':
if (!in_array($data, $this->maintainer_roles)) {
trigger_error("The maintainer role: '$data' is not valid", E_USER_WARNING);
} else {
$this->current_maintainer['role'] .= $data;
}
break;
- case 'Version':
+ case 'VERSION':
if ($this->in_changelog) {
$this->current_release['version'] .= $data;
} else {
$this->pkginfo['version'] .= $data;
}
break;
- case 'Date':
+ case 'DATE':
if ($this->in_changelog) {
$this->current_release['release_date'] .= $data;
} else {
$this->pkginfo['release_date'] .= $data;
}
break;
- case 'Notes':
+ case 'NOTES':
if ($this->in_changelog) {
$this->current_release['release_notes'] .= $data;
} else {
$this->pkginfo['release_notes'] .= $data;
}
break;
- case 'State':
+ case 'STATE':
if (!in_array($data, $this->releases_states)) {
trigger_error("The release state: '$data' is not valid", E_USER_WARNING);
} elseif ($this->in_changelog) {
$this->pkginfo['release_state'] .= $data;
}
break;
- case 'Dir':
+ case 'DIR':
break;
- case 'File':
- $role = strtolower($this->current_attributes['Role']);
+ case 'FILE':
+ $role = strtolower($this->current_attributes['ROLE']);
$this->current_file = trim($data);
break;
- case 'LibName':
+ case 'LIBNAME':
$this->lib_name = trim($data);
break;
- case 'Sources':
+ case 'SOURCES':
$this->lib_sources[] = trim($data);
break;
}
xml_set_object($xp, $this);
xml_set_element_handler($xp, '_element_start', '_element_end');
xml_set_character_data_handler($xp, '_pkginfo_cdata');
- xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, false);
+ xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, true);
$this->element_stack = array();
$this->pkginfo = array();
function _element_end($xp, $name)
{
array_pop($this->element_stack);
- if ($name == "Package")
+ if ($name == "PACKAGE")
{
$this->AllPackages[$this->pkginfo["name"]] = $this->pkginfo;
$this->pkginfo = array();
{
$next = $this->element_stack[sizeof($this->element_stack)-1];
switch ($this->current_element) {
- case "Name":
+ case "NAME":
$this->pkginfo["name"] .= $data;
break;
- case "Summary":
+ case "SUMMARY":
$this->pkginfo["summary"] .= $data;
break;
- case "Initials":
+ case "INITIALS":
$this->pkginfo["maintainer_handle"] .= $data;
break;
- case "Email":
+ case "EMAIL":
$this->pkginfo["maintainer_email"] .= $data;
break;
- case "Version":
+ case "VERSION":
$this->pkginfo["version"] .= $data;
break;
- case "Date":
+ case "DATE":
$this->pkginfo["release_date"] .= $data;
break;
- case "Notes":
+ case "NOTES":
$this->pkginfo["release_notes"] .= $data;
break;
- case "Dir":
+ case "DIR":
if (!$this->installdir) {
break;
}
$dir = trim($data);
// XXX add to file list
break;
- case "File":
- $role = strtolower($this->current_attributes["Role"]);
+ case "FILE":
+ $role = strtolower($this->current_attributes["ROLE"]);
$file = trim($data);
// XXX add to file list
break;
xml_set_element_handler($xp, "_element_start", "_element_end");
xml_set_character_data_handler($xp, "_pkginfo_cdata");
- xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, false);
+ xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, true);
$this->element_stack = array();
$this->pkginfo = array();
}
}
function help ($Full = False) {
-global $PHP_SELF;
+ global $PHP_SELF;
$this->loggerEnd();
print "From the WebInstaller.php introduction: <p>";