Changed include syntax to be a full path instead of a relative path.
authorAlan J. Pippin <ajp@server.pippins.net>
Mon, 18 Feb 2008 04:07:43 +0000 (21:07 -0700)
committerAlan J. Pippin <ajp@pippins.net>
Mon, 18 Feb 2008 04:07:43 +0000 (21:07 -0700)
Renamed db upgrade command to better fit the naming convention I want to follow long term.

bin/merge_eq_ppi_eq_interview_tables [deleted file]
bin/upgrade_1_0_to_2_0 [new file with mode: 0755]
inc/class.eq.inc.php

diff --git a/bin/merge_eq_ppi_eq_interview_tables b/bin/merge_eq_ppi_eq_interview_tables
deleted file mode 100755 (executable)
index cd7484b..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/perl
-
-use DBI;
-use Getopt::Std;
-
-$mydir = `cd \$(dirname $0) 2>/dev/null; pwd`; chomp($mydir);
-unshift @INC,("$mydir/../setup");
-if( -f "$mydir/../setup/db_config.local") { require "db_config.local"; }
-else { require "db_config"; }
-
-###################################################
-# Connect to the database
-$dbh=DBI->connect("dbi:mysql:dbname=$dbname:host=$dbhost:port=$dbport",$dbuser,$dbpass,{
-    AutoCommit=>0,
-    PrintError=>0}) or print "Connect Failure:".$DBI::errstr."\n" and exit 2;
-###################################################
-
-# Add a new 'aaronic' column to the eq_ppi table
-$sth = $dbh->prepare("ALTER TABLE `eq_ppi` ADD `aaronic` INT( 16 ) NOT NULL DEFAULT '0' AFTER `elder`");
-$sth->execute or die "-E- DB error: $DBI::errstr\n";
-
-# Parse the data out of the eq_interview table and add them to the eq_ppi table
-$sth = $dbh->prepare("select * from eq_interview");
-$sth->execute or die "-E- DB error: $DBI::errstr\n";
-while($row = $sth->fetchrow_hashref) {
-    $interviewer = $row->{interviewer};
-    $elder = $row->{elder};
-    $aaronic = $row->{aaronic};
-    $date = $row->{date};
-    $notes = $row->{notes};
-    $notes =~ s/\'/\\\'/g;
-    $eqpresppi = 0;
-    #print "$interviewer $elder $aaronic $date $eqpresppi $notes\n";
-    $sth2 = $dbh->prepare("insert into eq_ppi values (NULL,'$interviewer','$elder','$aaronic','$date','$notes','$eqpresppi')");
-    $sth2->execute or die "-E- DB error: $DBI::errstr\n";
-}
-
-print "\n-> Succesfully imported all eq_interview table entries into eq_ppi table...\n";
-print "-> You may drop the eq_interview table once you know all your data was transferred to the eq_ppi table correctly..\n";
-
-###################################################
-# Disconnect from the database
-$dbh->disconnect();
-###################################################
-
-
diff --git a/bin/upgrade_1_0_to_2_0 b/bin/upgrade_1_0_to_2_0
new file mode 100755 (executable)
index 0000000..cd7484b
--- /dev/null
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+
+use DBI;
+use Getopt::Std;
+
+$mydir = `cd \$(dirname $0) 2>/dev/null; pwd`; chomp($mydir);
+unshift @INC,("$mydir/../setup");
+if( -f "$mydir/../setup/db_config.local") { require "db_config.local"; }
+else { require "db_config"; }
+
+###################################################
+# Connect to the database
+$dbh=DBI->connect("dbi:mysql:dbname=$dbname:host=$dbhost:port=$dbport",$dbuser,$dbpass,{
+    AutoCommit=>0,
+    PrintError=>0}) or print "Connect Failure:".$DBI::errstr."\n" and exit 2;
+###################################################
+
+# Add a new 'aaronic' column to the eq_ppi table
+$sth = $dbh->prepare("ALTER TABLE `eq_ppi` ADD `aaronic` INT( 16 ) NOT NULL DEFAULT '0' AFTER `elder`");
+$sth->execute or die "-E- DB error: $DBI::errstr\n";
+
+# Parse the data out of the eq_interview table and add them to the eq_ppi table
+$sth = $dbh->prepare("select * from eq_interview");
+$sth->execute or die "-E- DB error: $DBI::errstr\n";
+while($row = $sth->fetchrow_hashref) {
+    $interviewer = $row->{interviewer};
+    $elder = $row->{elder};
+    $aaronic = $row->{aaronic};
+    $date = $row->{date};
+    $notes = $row->{notes};
+    $notes =~ s/\'/\\\'/g;
+    $eqpresppi = 0;
+    #print "$interviewer $elder $aaronic $date $eqpresppi $notes\n";
+    $sth2 = $dbh->prepare("insert into eq_ppi values (NULL,'$interviewer','$elder','$aaronic','$date','$notes','$eqpresppi')");
+    $sth2->execute or die "-E- DB error: $DBI::errstr\n";
+}
+
+print "\n-> Succesfully imported all eq_interview table entries into eq_ppi table...\n";
+print "-> You may drop the eq_interview table once you know all your data was transferred to the eq_ppi table correctly..\n";
+
+###################################################
+# Disconnect from the database
+$dbh->disconnect();
+###################################################
+
+
index e8b0fa453058fea8954f6bdce2783b4ca5c0a44e..b3730dde2037d5e54e53b94646cc4d95fa1aab7a 100644 (file)
@@ -68,12 +68,13 @@ class eq
  
   function eq()
     {
  
   function eq()
     {
-      if(file_exists('setup/eq_config.local')) {
-       include('setup/eq_config.local');
+      $base_path = $_SERVER['DOCUMENT_ROOT'];
+      if(file_exists("$base_path/eq/setup/eq_config.local")) {
+       include("$base_path/eq/setup/eq_config.local");
       } else {
       } else {
-       include('setup/eq_config');
+       include("$base_path/eq/setup/eq_config");
       }
       }
-
+      
       $this->script_path = "$this->application_path"."/bin";
       $this->max_presidency_members = 99;
       $this->max_appointments = 32768;
       $this->script_path = "$this->application_path"."/bin";
       $this->max_presidency_members = 99;
       $this->max_appointments = 32768;