NYCPHP Meetup

NYPHP.org

[nycphp-talk] XML <-> Globals

Jon Baer jonbaer at jonbaer.net
Wed Jul 9 15:36:01 EDT 2003


im trying to attempt to dump some properties for an application into an xml
file that looks as such:

<?xml version="1.0" ?>
<register>
 <global name="foo">bar</global>
 <global name="name">jon baer</global>
 <global name="prefix">00:30:00</global>
</register>

and using phpxmlclasses ...

<?
include_once("class_path_parser.php");

function register($name,$attribs,$content) {
  $key = $attribs['name'];
  echo("Key: $key Value: $content<br/>");
}

$parser = new Path_parser();
$parser->set_handler("/register/global","register");
if(!$parser->parse_file("globals.xml")) {
  print("Error:".$parser->get_error()."<br/>\n");
}
?>

what id like to end up w/ is a common file that all my objects/pages can
read and dump into something like $_XML['foo'] similar to the other
predefined variables.  what is the best method to attempt this if i want my
order to go as such:  XML->SESSION->POST->GET->etc.

im trying to do the same with $_REMOTE['foo'] to read a connection if it can
be made.

if i place it in the auto_include (php.ini) would this work?

pgp key: http://www.jonbaer.net/jonbaer.asc
fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47




More information about the talk mailing list