Gnucomo-0.0.3: December 6th 2002
$Log: gcm_daemon.php,v $
- Revision 1.9 2003-02-21 08:37:59 arjen
+ Revision 1.10 2003-03-29 08:33:58 arjen
+ In phpclasses/db.class.php: Added the database connection string as
+ an argument to the function copy_db_class.
+ Fixed the PHP member function db::db_connect(). The Postgres connection
+ string is now passed as an argument to that function.
+
+ Revision 1.9 2003/02/21 08:37:59 arjen
Added new table to the database: log_adv_daemon_email.
*/
-// $Id: gcm_daemon.php,v 1.9 2003-02-21 08:37:59 arjen Exp $
+// $Id: gcm_daemon.php,v 1.10 2003-03-29 08:33:58 arjen Exp $
ini_set('include_path', '.:./classes:../phpclasses');
$project_name = "gnucomo"; //name of the entire project
$app_name = "gcm_daemon"; //name of the application running
$developrelease = "TRUE"; //Indicates if special debug settings are needed
-$db_version = 32; //The db_version indicates what the level of
+$db_version = 36; //The db_version indicates what the level of
//the database should be. If the database is
//old an update will be generated.
$gcmd_version = 3; //This value indicates the active version of the gcm_daemon,
// Read the database settings //
$class_settings = new gnucomo_config();
$class_settings->read($project_name);
-$class_settings->database();
//Open an connection to the database
$dbms_type = $class_settings->find_parameter("database", "type");
$dbms->db_name = $dbms_name;
$dbms->db_user = $dbms_user;
$dbms->db_password = $dbms_password;
-$dbms->db_connect();
+$dbms->db_connect($class_settings->database());
if ($dbms->have_db_connection() == "FALSE") {
exit ("Database connection failed.");
} else {
//The database connection has been made.
- $dbms_working = copy_db_class($dbms);
+ $dbms_working = copy_db_class($dbms, $class_settings->database());
}
//Verify if the database is up-to-date by checking the versionnumber
*/
global $dbms;
global $dbms_working;
+ global $class_settings;
//Find records in log that still have to be processed.
$dbms->query($local_sql);
//Update the log-statistics in the object-table
- $local_statistics_db = copy_db_class($dbms);
- $local_findobject_db = copy_db_class($dbms);
+ $local_statistics_db = copy_db_class($dbms, $class_settings->database());
+ $local_findobject_db = copy_db_class($dbms, $class_settings->database());
//Make totals
$local_upper_row = $dbms->num_rows() + $last_log + 1;
if ($dbms->num_rows() > 0) {
//Create a database connection for changes in the database.
- $dbms_changes = copy_db_class($dbms);
+ $dbms_changes = copy_db_class($dbms, $class_settings->database());
if ($dbms_changes->have_db_connection() == 'TRUE') {
$local_sql = 0 ;
* OUTPUT : NONE
*/
- global $dbms;
+ global $dbms, $class_settings;
//Find records in log that still have to be processed.
$local_sql = "SELECT setting_value FROM db_value WHERE setting = 'last_notification'";
$dbms->query($local_sql);
- $local_dbms = copy_db_class($dbms);
+ $local_dbms = copy_db_class($dbms, $class_settings->database());
//Determine the last notification
if ($dbms->fetch_row() == "TRUE") {