From 74c6c4089652792fe55ad183af02b48822b3f8ea Mon Sep 17 00:00:00 2001 From: arjen Date: Sat, 8 Feb 2003 07:44:04 +0000 Subject: [PATCH] Directory structure of PHP scripts reorganized. PHP scripts that are included in both gcm_daemon and the web interface are now in the directory src/phpclasses. --- src/gcm_daemon/classes/configuration.class.php | 114 ----------------------- src/gcm_daemon/classes/gnucomo_config.class.php | 67 -------------- src/web/classes/configuration.class.php | 116 ------------------------ src/web/classes/gnucomo_config.php | 81 ----------------- 4 files changed, 378 deletions(-) delete mode 100755 src/gcm_daemon/classes/configuration.class.php delete mode 100644 src/gcm_daemon/classes/gnucomo_config.class.php delete mode 100644 src/web/classes/configuration.class.php delete mode 100644 src/web/classes/gnucomo_config.php diff --git a/src/gcm_daemon/classes/configuration.class.php b/src/gcm_daemon/classes/configuration.class.php deleted file mode 100755 index fa25a7d..0000000 --- a/src/gcm_daemon/classes/configuration.class.php +++ /dev/null @@ -1,114 +0,0 @@ -type == XML_ELEMENT_NODE && $node[$i]->tagname == $tag) - { - $element = $node[$i]; - } - $i++; - } - - return $element; - } - - function read($app_name) - { - $filename = "/etc/" . $app_name . ".conf"; - $this->system = xmldocfile($filename); - - if (!$this->system) - { - $filename = "/usr/local/etc/" . $app_name . ".conf"; - $this->system = xmldocfile($filename); - } - - if ($this->system) - { - $root = $this->system->root(); - - if ($root->tagname != $app_name) - { - print("Configuration error: Wrong configuration file.
"); - $this->system = false; - } - } - else - { - print("Configuration error: Configuration file for $app_name not found.
"); - } - } - - function find_parameter($section, $parameter) - { - $param_value = ""; - - if ($this->system) - { - $root_node = $this->system->root(); - $section_node = $this->xmlFindTag($root_node->children(), $section); - if ($section_node) - { - $param_node = $this->xmlFindTag($section_node->children(), $parameter); - if ($param_node) - { - $param_node = $param_node->children(); - } - if ($param_node && $param_node[0]->type == XML_TEXT_NODE) - { - $param_value = $param_node[0]->content; - } - } - } - - return $param_value; - } -} - -?> diff --git a/src/gcm_daemon/classes/gnucomo_config.class.php b/src/gcm_daemon/classes/gnucomo_config.class.php deleted file mode 100644 index 8453adb..0000000 --- a/src/gcm_daemon/classes/gnucomo_config.class.php +++ /dev/null @@ -1,67 +0,0 @@ -find_parameter("database", "name"); - if ($param != "") - { - $access_string .= "dbname=" . $param; - } - - $param = $this->find_parameter("database", "user"); - if ($param != "") - { - $access_string .= " user=" . $param; - } - - $param = $this->find_parameter("database", "password"); - if ($param != "") - { - $access_string .= " password=" . $param; - } - - $param = $this->find_parameter("database", "host"); - if ($param != "") - { - $access_string .= " host=" . $param; - } - - $param = $this->find_parameter("database", "port"); - if ($param != "") - { - $access_string .= " port=" . $param; - } - return $access_string; - } -}; -?> diff --git a/src/web/classes/configuration.class.php b/src/web/classes/configuration.class.php deleted file mode 100644 index 30a1446..0000000 --- a/src/web/classes/configuration.class.php +++ /dev/null @@ -1,116 +0,0 @@ -type == XML_ELEMENT_NODE && $node[$i]->tagname == $tag) - { - $element = $node[$i]; - } - $i++; - } - - return $element; - } - - function read($app_name) - { - $filename = "/etc/" . $app_name . ".conf"; - if (!is_readable($filename)) - { - $filename = "/usr/local/etc/" . $app_name . ".conf"; - } - if (is_readable($filename)) - { - - $this->system = xmldocfile($filename); - - if ($this->system) - { - $root = $this->system->root(); - - if ($root->tagname != $app_name) - { - print("Configuration error: Wrong configuration file.
"); - $this->system = false; - } - } - } - else - { - print("Configuration error: Configuration file for $app_name not found.
"); - } - } - - function find_parameter($section, $parameter) - { - $param_value = ""; - - if ($this->system) - { - $root_node = $this->system->root(); - $section_node = $this->xmlFindTag($root_node->children(), $section); - if ($section_node) - { - $param_node = $this->xmlFindTag($section_node->children(), $parameter); - if ($param_node) - { - $param_node = $param_node->children(); - } - if ($param_node && $param_node[0]->type == XML_TEXT_NODE) - { - $param_value = $param_node[0]->content; - } - } - } - - return $param_value; - } -} - -?> diff --git a/src/web/classes/gnucomo_config.php b/src/web/classes/gnucomo_config.php deleted file mode 100644 index 507a462..0000000 --- a/src/web/classes/gnucomo_config.php +++ /dev/null @@ -1,81 +0,0 @@ -find_parameter("database", "name"); - if ($param != "") - { - $access_string .= "dbname=" . $param; - } - - if ($usr == "") - { - $param = $this->find_parameter("database", "user"); - if ($param != "") - { - $access_string .= " user=" . $param; - } - } - else - { - $access_string .= " user=" . $usr; - } - - if ($pw == "") - { - $param = $this->find_parameter("database", "password"); - if ($param != "") - { - $access_string .= " password=" . $param; - } - } - else - { - $access_string .= " password=" . $pw; - } - - $param = $this->find_parameter("database", "host"); - if ($param != "") - { - $access_string .= " host=" . $param; - } - - $param = $this->find_parameter("database", "port"); - if ($param != "") - { - $access_string .= " port=" . $param; - } - return $access_string; - } -}; -?> -- 2.11.0