summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/db_schema/db_schema_10_11.php12
-rw-r--r--includes/db_schema/db_schema_11_12.php10
-rw-r--r--includes/db_schema/db_schema_12_13.php12
-rw-r--r--includes/db_schema/db_schema_13_14.php8
-rw-r--r--includes/db_schema/db_schema_14_15.php12
-rw-r--r--includes/db_schema/db_schema_15_16.php18
-rw-r--r--includes/db_schema/db_schema_16_17.php16
-rw-r--r--includes/db_schema/db_schema_17_18.php12
-rw-r--r--includes/db_schema/db_schema_18_19.php8
-rw-r--r--includes/db_schema/db_schema_19_20.php10
-rw-r--r--includes/db_schema/db_schema_1_2.php7
-rw-r--r--includes/db_schema/db_schema_20_21.php14
-rw-r--r--includes/db_schema/db_schema_21_22.php21
-rw-r--r--includes/db_schema/db_schema_22_23.php33
-rw-r--r--includes/db_schema/db_schema_23_24.php7
-rw-r--r--includes/db_schema/db_schema_24_25.php11
-rw-r--r--includes/db_schema/db_schema_25_26.php9
-rw-r--r--includes/db_schema/db_schema_26_27.php20
-rw-r--r--includes/db_schema/db_schema_27_28.php19
-rw-r--r--includes/db_schema/db_schema_2_3.php9
-rw-r--r--includes/db_schema/db_schema_3_4.php15
-rw-r--r--includes/db_schema/db_schema_4_5.php13
-rw-r--r--includes/db_schema/db_schema_5_6.php7
-rw-r--r--includes/db_schema/db_schema_6_7.php12
-rw-r--r--includes/db_schema/db_schema_7_8.php12
-rw-r--r--includes/db_schema/db_schema_8_9.php8
-rw-r--r--includes/db_schema/db_schema_9_10.php10
-rw-r--r--modules_v3/gedcom_favorites/db_schema/db_schema_0_1.php5
-rw-r--r--modules_v3/gedcom_favorites/db_schema/db_schema_1_2.php5
-rw-r--r--modules_v3/gedcom_favorites/db_schema/db_schema_2_3.php5
-rw-r--r--modules_v3/gedcom_favorites/db_schema/db_schema_3_4.php5
-rw-r--r--modules_v3/gedcom_news/db_schema/db_schema_0_1.php5
-rw-r--r--modules_v3/gedcom_news/db_schema/db_schema_1_2.php5
-rw-r--r--modules_v3/gedcom_news/db_schema/db_schema_2_3.php5
-rw-r--r--modules_v3/googlemap/db_schema/db_schema_0_1.php5
-rw-r--r--modules_v3/googlemap/db_schema/db_schema_1_2.php5
-rw-r--r--modules_v3/googlemap/db_schema/db_schema_2_3.php5
-rw-r--r--modules_v3/googlemap/db_schema/db_schema_3_4.php10
-rw-r--r--modules_v3/googlemap/db_schema/db_schema_4_5.php7
-rw-r--r--modules_v3/user_blog/db_schema/db_schema_0_1.php5
-rw-r--r--modules_v3/user_blog/db_schema/db_schema_1_2.php5
-rw-r--r--modules_v3/user_blog/db_schema/db_schema_2_3.php5
42 files changed, 102 insertions, 325 deletions
diff --git a/includes/db_schema/db_schema_10_11.php b/includes/db_schema/db_schema_10_11.php
index 0aeae07a5d..5ca49f858d 100644
--- a/includes/db_schema/db_schema_10_11.php
+++ b/includes/db_schema/db_schema_10_11.php
@@ -2,7 +2,7 @@
// Update the database schema from version 10 to 11
// - delete old configuration setting
// - increase password field from 64 to 128 chars (some versions of PHP use
-// the SHA512 algorithm for crypt() which generates 98 digit hashes)
+// the SHA512 algorithm for crypt() which generates 98 digit hashes)
//
// The script should assume that it can be interrupted at
// any point, and be able to continue by re-running the script.
@@ -28,17 +28,11 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Delete some old/unused config settings
-self::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('SEARCH_FACTS_DEFAULT', 'DISPLAY_JEWISH_GERESHAYIM', 'DISPLAY_JEWISH_THOUSANDS')");
+WT_DB::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('SEARCH_FACTS_DEFAULT', 'DISPLAY_JEWISH_GERESHAYIM', 'DISPLAY_JEWISH_THOUSANDS')");
// Increase the password column from 64 to 128 characters
-self::exec("ALTER TABLE `##user` CHANGE password password VARCHAR(128) COLLATE utf8_unicode_ci NOT NULL");
+WT_DB::exec("ALTER TABLE `##user` CHANGE password password VARCHAR(128) COLLATE utf8_unicode_ci NOT NULL");
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_11_12.php b/includes/db_schema/db_schema_11_12.php
index cba3ae70b0..1515278b40 100644
--- a/includes/db_schema/db_schema_11_12.php
+++ b/includes/db_schema/db_schema_11_12.php
@@ -30,21 +30,15 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Remove slashes from INDI names
-self::exec("UPDATE `##name` SET n_full=REPLACE(n_full, '/', '') WHERE n_surn IS NOT NULL");
+WT_DB::exec("UPDATE `##name` SET n_full=REPLACE(n_full, '/', '') WHERE n_surn IS NOT NULL");
// Remove the n_list column
try {
- self::exec("ALTER TABLE `##name` DROP n_list");
+ WT_DB::exec("ALTER TABLE `##name` DROP n_list");
} catch (PDOException $x) {
// Already done?
}
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_12_13.php b/includes/db_schema/db_schema_12_13.php
index f98544dda7..cd86b970ac 100644
--- a/includes/db_schema/db_schema_12_13.php
+++ b/includes/db_schema/db_schema_12_13.php
@@ -26,22 +26,16 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Convert MULTI_MEDIA (0=false, 1=true) to MEDIA_UPLOAD (1=members, 0=managers, -1=nobody)
try {
- self::exec("UPDATE `##gedcom_setting` SET setting_name='MEDIA_UPLOAD' WHERE setting_name='MULTI_MEDIA'");
+ WT_DB::exec("UPDATE `##gedcom_setting` SET setting_name='MEDIA_UPLOAD' WHERE setting_name='MULTI_MEDIA'");
} catch (PDOException $ex) {
// This could theoretically cause a duplicate key error, if a MULTI_MEDIA setting already exists
}
// Remove old settings
-self::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('SHOW_MEDIA_FILENAME', 'USE_THUMBS_MAIN', 'MULTI_MEDIA')");
-self::exec("DELETE FROM `##default_resn` WHERE tag_type IN ('_PRIM')");
+WT_DB::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('SHOW_MEDIA_FILENAME', 'USE_THUMBS_MAIN', 'MULTI_MEDIA')");
+WT_DB::exec("DELETE FROM `##default_resn` WHERE tag_type IN ('_PRIM')");
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_13_14.php b/includes/db_schema/db_schema_13_14.php
index b762493bf5..b49476d52e 100644
--- a/includes/db_schema/db_schema_13_14.php
+++ b/includes/db_schema/db_schema_13_14.php
@@ -26,18 +26,12 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Remove the i_isdead column
try {
- self::exec("ALTER TABLE `##individuals` DROP i_isdead");
+ WT_DB::exec("ALTER TABLE `##individuals` DROP i_isdead");
} catch (PDOException $ex) {
// Already done this?
}
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_14_15.php b/includes/db_schema/db_schema_14_15.php
index 9208b8887f..23f883029a 100644
--- a/includes/db_schema/db_schema_14_15.php
+++ b/includes/db_schema/db_schema_14_15.php
@@ -27,18 +27,12 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Remove the i_isdead column
-self::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN('GEDCOM_DEFAULT_TAB', 'LINK_ICONS', 'ZOOM_BOXES')");
-self::exec("DELETE FROM `##user_setting` WHERE setting_name='default'");
+WT_DB::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN('GEDCOM_DEFAULT_TAB', 'LINK_ICONS', 'ZOOM_BOXES')");
+WT_DB::exec("DELETE FROM `##user_setting` WHERE setting_name='default'");
// There is no way to add a RESN tag to NOTE objects
-self::exec("UPDATE `##gedcom_setting` SET setting_value='SOUR,RESN' WHERE setting_name='NOTE_FACTS_ADD' AND setting_value='SOUR'");
+WT_DB::exec("UPDATE `##gedcom_setting` SET setting_value='SOUR,RESN' WHERE setting_name='NOTE_FACTS_ADD' AND setting_value='SOUR'");
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_15_16.php b/includes/db_schema/db_schema_15_16.php
index 59e0190c06..bf6e6dbcb2 100644
--- a/includes/db_schema/db_schema_15_16.php
+++ b/includes/db_schema/db_schema_15_16.php
@@ -27,26 +27,20 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Remove old settings
-self::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN('GEDCOM_DEFAULT_TAB', 'LINK_ICONS', 'ZOOM_BOXES', 'SHOW_LIST_PLACES', 'SHOW_CONTEXT_HELP')");
-self::exec("DELETE FROM `##user_setting` WHERE setting_name='defaulttab'");
+WT_DB::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN('GEDCOM_DEFAULT_TAB', 'LINK_ICONS', 'ZOOM_BOXES', 'SHOW_LIST_PLACES', 'SHOW_CONTEXT_HELP')");
+WT_DB::exec("DELETE FROM `##user_setting` WHERE setting_name='defaulttab'");
// There is no way to add a RESN tag to NOTE objects
-self::exec("UPDATE `##gedcom_setting` SET setting_value='SOUR,RESN' WHERE setting_name='NOTE_FACTS_ADD' AND setting_value='SOUR'");
+WT_DB::exec("UPDATE `##gedcom_setting` SET setting_value='SOUR,RESN' WHERE setting_name='NOTE_FACTS_ADD' AND setting_value='SOUR'");
// This needs to be an absolute URL. If not set, it defaults to the full path to login.php
-self::exec("DELETE FROM `##site_setting` WHERE setting_name='LOGIN_URL' AND setting_value='login.php'");
+WT_DB::exec("DELETE FROM `##site_setting` WHERE setting_name='LOGIN_URL' AND setting_value='login.php'");
// No need for an empty value
-self::exec("DELETE FROM `##site_setting` WHERE setting_name='SERVER_URL' AND setting_value=''");
+WT_DB::exec("DELETE FROM `##site_setting` WHERE setting_name='SERVER_URL' AND setting_value=''");
// Later PHP versions use session IDs longer than 32 chars.
-self::exec("ALTER TABLE `##session` CHANGE session_id session_id CHAR(128) COLLATE utf8_unicode_ci NOT NULL");
+WT_DB::exec("ALTER TABLE `##session` CHANGE session_id session_id CHAR(128) COLLATE utf8_unicode_ci NOT NULL");
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_16_17.php b/includes/db_schema/db_schema_16_17.php
index 12ee115730..293b411a93 100644
--- a/includes/db_schema/db_schema_16_17.php
+++ b/includes/db_schema/db_schema_16_17.php
@@ -26,27 +26,21 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Add a "default" user, to store default settings
-self::exec("INSERT IGNORE INTO `##user` (user_id, user_name, real_name, email, password) VALUES (-1, 'DEFAULT_USER', 'DEFAULT_USER', 'DEFAULT_USER', 'DEFAULT_USER')");
+WT_DB::exec("INSERT IGNORE INTO `##user` (user_id, user_name, real_name, email, password) VALUES (-1, 'DEFAULT_USER', 'DEFAULT_USER', 'DEFAULT_USER', 'DEFAULT_USER')");
// Add the initial default block settings
-self::exec("INSERT IGNORE INTO `##block` (user_id, location, block_order, module_name) VALUES (-1, 'main', 1, 'todays_events'), (-1, 'main', 2, 'user_messages'), (-1, 'main', 3, 'user_favorites'), (-1, 'side', 1, 'user_welcome'), (-1, 'side', 2, 'random_media'), (-1, 'side', 3, 'upcoming_events'), (-1, 'side', 4, 'logged_in')");
+WT_DB::exec("INSERT IGNORE INTO `##block` (user_id, location, block_order, module_name) VALUES (-1, 'main', 1, 'todays_events'), (-1, 'main', 2, 'user_messages'), (-1, 'main', 3, 'user_favorites'), (-1, 'side', 1, 'user_welcome'), (-1, 'side', 2, 'random_media'), (-1, 'side', 3, 'upcoming_events'), (-1, 'side', 4, 'logged_in')");
// Add a "default" tree, to store default settings
-self::exec("INSERT IGNORE INTO `##gedcom` (gedcom_id, gedcom_name) VALUES (-1, 'DEFAULT_TREE')");
+WT_DB::exec("INSERT IGNORE INTO `##gedcom` (gedcom_id, gedcom_name) VALUES (-1, 'DEFAULT_TREE')");
// Add the initial default block settings
-self::exec("INSERT IGNORE INTO `##block` (gedcom_id, location, block_order, module_name) VALUES (-1, 'main', 1, 'gedcom_stats'), (-1, 'main', 2, 'gedcom_news'), (-1, 'main', 3, 'gedcom_favorites'), (-1, 'main', 4, 'review_changes'), (-1, 'side', 1, 'gedcom_block'), (-1, 'side', 2, 'random_media'), (-1, 'side', 3, 'todays_events'), (-1, 'side', 4, 'logged_in')");
+WT_DB::exec("INSERT IGNORE INTO `##block` (gedcom_id, location, block_order, module_name) VALUES (-1, 'main', 1, 'gedcom_stats'), (-1, 'main', 2, 'gedcom_news'), (-1, 'main', 3, 'gedcom_favorites'), (-1, 'main', 4, 'review_changes'), (-1, 'side', 1, 'gedcom_block'), (-1, 'side', 2, 'random_media'), (-1, 'side', 3, 'todays_events'), (-1, 'side', 4, 'logged_in')");
// Some modules (e.g. sitemap) require larger settings
-self::exec("ALTER TABLE `##module_setting` CHANGE setting_value setting_value MEDIUMTEXT COLLATE utf8_unicode_ci NOT NULL");
+WT_DB::exec("ALTER TABLE `##module_setting` CHANGE setting_value setting_value MEDIUMTEXT COLLATE utf8_unicode_ci NOT NULL");
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_17_18.php b/includes/db_schema/db_schema_17_18.php
index f44c342226..b520d329ba 100644
--- a/includes/db_schema/db_schema_17_18.php
+++ b/includes/db_schema/db_schema_17_18.php
@@ -26,12 +26,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-self::exec(
+WT_DB::exec(
"CREATE TABLE IF NOT EXISTS `##site_access_rule` (".
" site_access_rule_id INTEGER NOT NULL AUTO_INCREMENT,".
" ip_address_start INTEGER UNSIGNED NOT NULL DEFAULT 0,".
@@ -50,7 +45,7 @@ self::exec(
") ENGINE=InnoDB COLLATE=utf8_unicode_ci"
);
-self::exec(
+WT_DB::exec(
"INSERT IGNORE INTO `##site_access_rule` (user_agent_pattern, rule, comment) VALUES".
" ('Mozilla/5.0 (%) Gecko/% %/%', 'allow', 'Gecko-based browsers'),".
" ('Mozilla/5.0 (%) AppleWebKit/% (KHTML, like Gecko)%', 'allow', 'WebKit-based browsers'),".
@@ -61,8 +56,7 @@ self::exec(
// Don't do this. We can’t easily/safely migrate the data, and the user may
// wish to migrate it manually....
-//self::exec("DROP TABLE IF EXISTS `##wt_ip_address`");
+//WT_DB::exec("DROP TABLE IF EXISTS `##wt_ip_address`");
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_18_19.php b/includes/db_schema/db_schema_18_19.php
index c24e6bc28c..3eccf56429 100644
--- a/includes/db_schema/db_schema_18_19.php
+++ b/includes/db_schema/db_schema_18_19.php
@@ -26,13 +26,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
try {
- self::exec(
+ WT_DB::exec(
"ALTER TABLE `##places`".
" DROP KEY ix1,".
" DROP KEY ix2,".
@@ -48,4 +43,3 @@ try {
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_19_20.php b/includes/db_schema/db_schema_19_20.php
index 4d500f9a8c..e3c45b7671 100644
--- a/includes/db_schema/db_schema_19_20.php
+++ b/includes/db_schema/db_schema_19_20.php
@@ -26,14 +26,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-self::exec("UPDATE `##default_resn` SET xref =NULL WHERE xref =''");
-self::exec("UPDATE `##default_resn` SET tag_type=NULL WHERE tag_type=''");
+WT_DB::exec("UPDATE `##default_resn` SET xref =NULL WHERE xref =''");
+WT_DB::exec("UPDATE `##default_resn` SET tag_type=NULL WHERE tag_type=''");
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_1_2.php b/includes/db_schema/db_schema_1_2.php
index 57a720c312..052bc97951 100644
--- a/includes/db_schema/db_schema_1_2.php
+++ b/includes/db_schema/db_schema_1_2.php
@@ -27,12 +27,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-self::exec(
+WT_DB::exec(
"CREATE TABLE IF NOT EXISTS `##session` (".
" session_id CHAR(32) NOT NULL,".
" session_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,".
diff --git a/includes/db_schema/db_schema_20_21.php b/includes/db_schema/db_schema_20_21.php
index 3d7529d6c6..e6756b3526 100644
--- a/includes/db_schema/db_schema_20_21.php
+++ b/includes/db_schema/db_schema_20_21.php
@@ -27,20 +27,15 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Delete old settings
-self::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('MEDIA_EXTERNAL')");
+WT_DB::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('MEDIA_EXTERNAL')");
// Delete old table
-self::exec("DROP TABLE IF EXISTS `##media_mapping`");
+WT_DB::exec("DROP TABLE IF EXISTS `##media_mapping`");
// Make this table look like all the others
try {
- self::exec(
+ WT_DB::exec(
"ALTER TABLE `##media`" .
" DROP m_id," .
" CHANGE m_media m_id VARCHAR(20) COLLATE utf8_unicode_ci NOT NULL," .
@@ -57,8 +52,7 @@ try {
}
// Populate the new column
-self::exec("UPDATE `##media` SET m_type = SUBSTRING_INDEX(SUBSTRING_INDEX(m_gedcom, '\n3 TYPE ', -1), '\n', 1) WHERE m_gedcom like '%\n3 TYPE %'");
+WT_DB::exec("UPDATE `##media` SET m_type = SUBSTRING_INDEX(SUBSTRING_INDEX(m_gedcom, '\n3 TYPE ', -1), '\n', 1) WHERE m_gedcom like '%\n3 TYPE %'");
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_21_22.php b/includes/db_schema/db_schema_21_22.php
index 922063080e..aeb152b80f 100644
--- a/includes/db_schema/db_schema_21_22.php
+++ b/includes/db_schema/db_schema_21_22.php
@@ -27,30 +27,25 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Data fix for bug #1072477
-self::exec("UPDATE `##default_resn` SET xref =NULL WHERE xref =''");
-self::exec("UPDATE `##default_resn` SET tag_type=NULL WHERE tag_type=''");
+WT_DB::exec("UPDATE `##default_resn` SET xref =NULL WHERE xref =''");
+WT_DB::exec("UPDATE `##default_resn` SET tag_type=NULL WHERE tag_type=''");
// Delete old settings
-self::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('AUTO_GENERATE_THUMBS', 'POSTAL_CODE', 'MEDIA_DIRECTORY_LEVELS', 'USE_MEDIA_VIEWER')");
+WT_DB::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('AUTO_GENERATE_THUMBS', 'POSTAL_CODE', 'MEDIA_DIRECTORY_LEVELS', 'USE_MEDIA_VIEWER')");
// Delete old settings
-self::exec("DELETE FROM `##module_setting` WHERE module_name='lightbox'");
+WT_DB::exec("DELETE FROM `##module_setting` WHERE module_name='lightbox'");
// Very old versions of phpGedView allowed media paths beginning “./”
// Remove these
-self::exec(
+WT_DB::exec(
"UPDATE `##media` m".
" SET".
" m_filename = TRIM(LEADING './' FROM m_filename),".
" m_gedcom = REPLACE(m_gedcom, '\n1 FILE ./', '\n1 FILE ')"
);
-self::exec(
+WT_DB::exec(
"UPDATE `##change` c".
" SET new_gedcom = REPLACE(new_gedcom, '\n1 FILE ./', '\n1 FILE ')".
" WHERE status = 'pending'"
@@ -58,7 +53,7 @@ self::exec(
// Previous versions of webtrees included the MEDIA_DIRECTORY setting in the
// FILE tag of the OBJE records. Remove it…
-self::exec(
+WT_DB::exec(
"UPDATE `##media` m".
" JOIN `##gedcom_setting` gs ON (m.m_file = gs.gedcom_id AND gs.setting_name = 'MEDIA_DIRECTORY')".
" SET".
@@ -66,7 +61,7 @@ self::exec(
" m_gedcom = REPLACE(m_gedcom, CONCAT('\n1 FILE ', gs.setting_value), '\n1 FILE ')"
);
// …don’t forget pending changes
-self::exec(
+WT_DB::exec(
"UPDATE `##change` c".
" JOIN `##gedcom_setting` gs ON (c.gedcom_id = gs.gedcom_id AND gs.setting_name = 'MEDIA_DIRECTORY')".
" SET new_gedcom = REPLACE(new_gedcom, CONCAT('\n1 FILE ', gs.setting_value), '\n1 FILE ')".
diff --git a/includes/db_schema/db_schema_22_23.php b/includes/db_schema/db_schema_22_23.php
index b3432294d1..ea9e619f0a 100644
--- a/includes/db_schema/db_schema_22_23.php
+++ b/includes/db_schema/db_schema_22_23.php
@@ -26,14 +26,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-$_data_dir = realpath(WT_Site::getPreference('INDEX_DIRECTORY') ? WT_Site::getPreference('INDEX_DIRECTORY') : 'data').DIRECTORY_SEPARATOR;
-
-$_cfgs = self::prepare(
+$_cfgs = WT_DB::prepare(
"SELECT gs1.gedcom_id AS gedcom_id, gs1.setting_value AS media_directory, gs2.setting_value AS use_media_firewall, gs3.setting_value AS media_firewall_thumbs, gs4.setting_value AS media_firewall_rootdir" .
" FROM `##gedcom_setting` gs1" .
" LEFT JOIN `##gedcom_setting` gs2 ON (gs1.gedcom_id = gs2.gedcom_id AND gs2.setting_name='USE_MEDIA_FIREWALL')" .
@@ -47,16 +40,16 @@ foreach ($_cfgs as $_cfg) {
if ($_cfg->use_media_firewall) {
// We’re using the media firewall.
$_mf_dir = realpath($_cfg->media_firewall_rootdir) . DIRECTORY_SEPARATOR;
- if ($_mf_dir == $_data_dir) {
+ if ($_mf_dir == WT_DATA_DIR) {
// We’re already storing our media in the data folder - nothing to do.
} else {
// We’ve chosen a custom location for our media folder - need to update our media-folder to point to it.
// We have, for example,
// $_mf_dir = /home/fisharebest/my_pictures/
- // $_data_dir = /home/fisharebest/public_html/webtrees/data/
+ // WT_DATA_DIR = /home/fisharebest/public_html/webtrees/data/
// Therefore we need to calculate ../../../my_pictures/
$_media_dir = '';
- $_tmp_dir = $_data_dir;
+ $_tmp_dir = WT_DATA_DIR;
while (strpos($_mf_dir, $_tmp_dir)!==0) {
$_media_dir .= '../';
$_tmp_dir = preg_replace('~[^/\\\\]+[/\\\\]$~', '', $_tmp_dir);
@@ -66,7 +59,7 @@ foreach ($_cfgs as $_cfg) {
}
}
$_media_dir .= $_cfg->media_directory;
- self::prepare(
+ WT_DB::prepare(
"UPDATE `##gedcom_setting`" .
" SET setting_value=?" .
" WHERE gedcom_id=? AND setting_name='MEDIA_DIRECTORY'"
@@ -77,21 +70,21 @@ foreach ($_cfgs as $_cfg) {
if (
file_exists(WT_ROOT . $_cfg->media_directory) &&
is_dir(WT_ROOT . $_cfg->media_directory) &&
- !file_exists($_data_dir . $_cfg->media_directory)
+ !file_exists(WT_DATA_DIR . $_cfg->media_directory)
) {
- @rename(WT_ROOT . $_cfg->media_directory, $_data_dir . $_cfg->media_directory);
- @unlink($_data_dir . $_cfg->media_directory . '.htaccess');
- @unlink($_data_dir . $_cfg->media_directory . 'index.php');
- @unlink($_data_dir . $_cfg->media_directory . 'Mediainfo.txt');
- @unlink($_data_dir . $_cfg->media_directory . 'thumbs/Thumbsinfo.txt');
+ @rename(WT_ROOT . $_cfg->media_directory, WT_DATA_DIR . $_cfg->media_directory);
+ WT_File::delete(WT_DATA_DIR . $_cfg->media_directory . '.htaccess');
+ WT_File::delete(WT_DATA_DIR . $_cfg->media_directory . 'index.php');
+ WT_File::delete(WT_DATA_DIR . $_cfg->media_directory . 'Mediainfo.txt');
+ WT_File::delete(WT_DATA_DIR . $_cfg->media_directory . 'thumbs/Thumbsinfo.txt');
}
}
}
-unset($_data_dir, $_cfgs, $_cfg, $_mf_dir, $_tmp_dir);
+unset($_cfgs, $_cfg, $_mf_dir, $_tmp_dir);
// Delete old settings
-self::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('USE_MEDIA_FIREWALL', 'MEDIA_FIREWALL_THUMBS', 'MEDIA_FIREWALL_ROOTDIR')");
+WT_DB::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('USE_MEDIA_FIREWALL', 'MEDIA_FIREWALL_THUMBS', 'MEDIA_FIREWALL_ROOTDIR')");
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
diff --git a/includes/db_schema/db_schema_23_24.php b/includes/db_schema/db_schema_23_24.php
index 19c45d68c9..823d85e606 100644
--- a/includes/db_schema/db_schema_23_24.php
+++ b/includes/db_schema/db_schema_23_24.php
@@ -27,12 +27,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-self::exec(
+WT_DB::exec(
"ALTER IGNORE TABLE `##media`" .
" CHANGE m_ext m_ext VARCHAR(6) COLLATE utf8_unicode_ci NOT NULL," .
" CHANGE m_type m_type VARCHAR(20) COLLATE utf8_unicode_ci NOT NULL," .
diff --git a/includes/db_schema/db_schema_24_25.php b/includes/db_schema/db_schema_24_25.php
index c9ebf7decf..b73a518ffa 100644
--- a/includes/db_schema/db_schema_24_25.php
+++ b/includes/db_schema/db_schema_24_25.php
@@ -26,13 +26,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Tree settings become site settings
-self::exec(
+WT_DB::exec(
"INSERT IGNORE INTO `##site_setting` (setting_name, setting_value)" .
" SELECT setting_name, setting_value" .
" FROM `##gedcom_setting`" .
@@ -40,11 +35,11 @@ self::exec(
" GROUP BY setting_name"
);
-self::exec(
+WT_DB::exec(
"DELETE FROM `##gedcom_setting` WHERE setting_name IN ('ALLOW_EDIT_GEDCOM', 'SHOW_REGISTER_CAUTION', 'WELCOME_TEXT_CUST_HEAD') OR setting_name like 'WELCOME_TEXT_AUTH_MODE%'"
);
-self::exec(
+WT_DB::exec(
"DELETE FROM `##site_setting` WHERE setting_name IN ('STORE_MESSAGES')"
);
diff --git a/includes/db_schema/db_schema_25_26.php b/includes/db_schema/db_schema_25_26.php
index 287f50f889..946e13196f 100644
--- a/includes/db_schema/db_schema_25_26.php
+++ b/includes/db_schema/db_schema_25_26.php
@@ -26,18 +26,13 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Site settings that are no longer used.
-self::exec(
+WT_DB::exec(
"DELETE FROM `##site_setting` WHERE setting_name IN ('WELCOME_TEXT_CUST_HEAD')"
);
// Modern versions of Internet Explorer use a different
-self::exec(
+WT_DB::exec(
"INSERT IGNORE INTO `##site_access_rule` (user_agent_pattern, rule, comment) VALUES".
" ('Mozilla/% (Windows%; Trident%; rv:%) like Gecko', 'allow', 'Modern Internet Explorer')"
);
diff --git a/includes/db_schema/db_schema_26_27.php b/includes/db_schema/db_schema_26_27.php
index b525c6127a..0619df0b3c 100644
--- a/includes/db_schema/db_schema_26_27.php
+++ b/includes/db_schema/db_schema_26_27.php
@@ -26,14 +26,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Earlier versions of webtrees put quote marks round soundex codes.
// These are harmless, but clean them up for consistency.
-self::exec(
+WT_DB::exec(
"UPDATE `##name` SET" .
" n_soundex_givn_std = TRIM('''' FROM n_soundex_givn_std)," .
" n_soundex_surn_std = TRIM('''' FROM n_soundex_surn_std)," .
@@ -43,21 +38,21 @@ self::exec(
// Earlier versions of webtrees added zero codes for names without phonetic content.
// These are harmless, but clean them up for consistency.
-self::exec(
+WT_DB::exec(
"UPDATE `##name` SET" .
" n_soundex_givn_std = REPLACE(n_soundex_givn_std, '0000:', '')," .
" n_soundex_surn_std = REPLACE(n_soundex_surn_std, '0000:', '')," .
" n_soundex_givn_dm = REPLACE(n_soundex_givn_dm, '000000:', '')," .
" n_soundex_surn_dm = REPLACE(n_soundex_surn_dm, '000000:', '')"
);
-self::exec(
+WT_DB::exec(
"UPDATE `##name` SET" .
" n_soundex_givn_std = REPLACE(n_soundex_givn_std, ':0000', '')," .
" n_soundex_surn_std = REPLACE(n_soundex_surn_std, ':0000', '')," .
" n_soundex_givn_dm = REPLACE(n_soundex_givn_dm, ':000000', '')," .
" n_soundex_surn_dm = REPLACE(n_soundex_surn_dm, ':000000', '')"
);
-self::exec(
+WT_DB::exec(
"UPDATE `##name` SET" .
" n_soundex_givn_std = NULLIF(n_soundex_givn_std, '0000' )," .
" n_soundex_surn_std = NULLIF(n_soundex_surn_std, '0000' )," .
@@ -65,22 +60,21 @@ self::exec(
" n_soundex_surn_dm = NULLIF(n_soundex_surn_dm, '000000')"
);
-self::exec(
+WT_DB::exec(
"UPDATE `##places` SET" .
" p_std_soundex = REPLACE(p_std_soundex, '0000:', '')," .
" p_dm_soundex = REPLACE(p_dm_soundex, '000000:', '')"
);
-self::exec(
+WT_DB::exec(
"UPDATE `##places` SET" .
" p_std_soundex = REPLACE(p_std_soundex, ':0000', '')," .
" p_dm_soundex = REPLACE(p_dm_soundex, ':000000', '')"
);
-self::exec(
+WT_DB::exec(
"UPDATE `##places` SET" .
" p_std_soundex = NULLIF(p_std_soundex, '0000' )," .
" p_dm_soundex = NULLIF(p_dm_soundex, '000000')"
);
-
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
diff --git a/includes/db_schema/db_schema_27_28.php b/includes/db_schema/db_schema_27_28.php
index dd9a033c84..951a23bee8 100644
--- a/includes/db_schema/db_schema_27_28.php
+++ b/includes/db_schema/db_schema_27_28.php
@@ -26,11 +26,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Delete old/unused settings
WT_DB::exec(
"DELETE FROM `##gedcom_setting` WHERE setting_name IN ('USE_GEONAMES')"
@@ -52,11 +47,15 @@ WT_DB::exec(
// ix1 - covering index for visitor lookup
// ix2 - for total counts in admin page
-//try {
- WT_DB::exec("ALTER TABLE `##site_access_rule` ADD UNIQUE INDEX `##site_access_rule_ix1` (ip_address_end, ip_address_start, user_agent_pattern, rule), ADD INDEX `##site_access_rule_ix2` (rule)");
-//} catch (Exception $ex) {
- // Already done?
-//}
+try {
+ WT_DB::exec(
+ "ALTER TABLE `##site_access_rule`" .
+ " ADD UNIQUE INDEX `##site_access_rule_ix1` (ip_address_end, ip_address_start, user_agent_pattern, rule)," .
+ " ADD INDEX `##site_access_rule_ix2` (rule)"
+ );
+} catch (Exception $ex) {
+ Already done?
+}
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
diff --git a/includes/db_schema/db_schema_2_3.php b/includes/db_schema/db_schema_2_3.php
index 1bb85c41ee..33c204a25f 100644
--- a/includes/db_schema/db_schema_2_3.php
+++ b/includes/db_schema/db_schema_2_3.php
@@ -27,12 +27,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-self::exec(
+WT_DB::exec(
"CREATE TABLE IF NOT EXISTS `##gedcom_chunk` (".
" gedcom_chunk_id INTEGER AUTO_INCREMENT NOT NULL,".
" gedcom_id INTEGER NOT NULL,".
@@ -45,7 +40,7 @@ self::exec(
);
try {
- self::exec(
+ WT_DB::exec(
"ALTER TABLE `##gedcom` DROP import_gedcom, DROP import_offset"
);
} catch (PDOException $ex) {
diff --git a/includes/db_schema/db_schema_3_4.php b/includes/db_schema/db_schema_3_4.php
index ab5959f52b..d85b7876c9 100644
--- a/includes/db_schema/db_schema_3_4.php
+++ b/includes/db_schema/db_schema_3_4.php
@@ -30,12 +30,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-self::exec(
+WT_DB::exec(
"INSERT IGNORE INTO `##user_gedcom_setting` (user_id, gedcom_id, setting_name, setting_value)".
" SELECT u.user_id, g.gedcom_id, 'RELATIONSHIP_PATH_LENGTH', LEAST(us1.setting_value, gs1.setting_value)".
" FROM `##user` u".
@@ -48,18 +43,18 @@ self::exec(
);
// Delete old/unused settings
-self::exec(
+WT_DB::exec(
"DELETE FROM `##site_setting` WHERE setting_name IN ('SESSION_SAVE_PATH')"
);
-self::exec(
+WT_DB::exec(
"DELETE FROM `##gedcom_setting` WHERE setting_name IN ('HOME_SITE_TEXT', 'HOME_SITE_URL', 'CHECK_MARRIAGE_RELATIONS', 'MAX_RELATION_PATH_LENGTH', 'USE_RELATIONSHIP_PRIVACY')"
);
-self::exec(
+WT_DB::exec(
"DELETE FROM `##user_setting` WHERE setting_name IN ('loggedin', 'relationship_privacy', 'max_relation_path_length')"
);
// Fix Mc/Mac problems - See SVN9701
-self::exec(
+WT_DB::exec(
"UPDATE `##name` SET n_surn=CONCAT('MC', SUBSTRING(n_surn, 4)) WHERE n_surn LIKE 'MC0%'"
);
diff --git a/includes/db_schema/db_schema_4_5.php b/includes/db_schema/db_schema_4_5.php
index ffae8d5ea7..5a9939a1e6 100644
--- a/includes/db_schema/db_schema_4_5.php
+++ b/includes/db_schema/db_schema_4_5.php
@@ -28,28 +28,23 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
try {
- self::exec("ALTER TABLE `##gedcom` ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0");
+ WT_DB::exec("ALTER TABLE `##gedcom` ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0");
} catch (PDOException $ex) {
// If this fails, it has probably already been done.
}
try {
- self::exec("ALTER TABLE `##gedcom` ADD INDEX ix1 (sort_order)");
+ WT_DB::exec("ALTER TABLE `##gedcom` ADD INDEX ix1 (sort_order)");
} catch (PDOException $ex) {
// If this fails, it has probably already been done.
}
// No longer used
-self::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('PAGE_AFTER_LOGIN')");
+WT_DB::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('PAGE_AFTER_LOGIN')");
// Change of defaults - do not add ASSO, etc. to NOTE objects
-self::exec("UPDATE `##gedcom_setting` SET setting_value='SOUR' WHERE setting_value='ASSO,SOUR,NOTE,REPO' AND setting_name='NOTE_FACTS_ADD'");
+WT_DB::exec("UPDATE `##gedcom_setting` SET setting_value='SOUR' WHERE setting_value='ASSO,SOUR,NOTE,REPO' AND setting_name='NOTE_FACTS_ADD'");
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
diff --git a/includes/db_schema/db_schema_5_6.php b/includes/db_schema/db_schema_5_6.php
index 626f48f844..68dd2a7c2f 100644
--- a/includes/db_schema/db_schema_5_6.php
+++ b/includes/db_schema/db_schema_5_6.php
@@ -26,12 +26,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-$settings=self::prepare(
+$settings=WT_DB::prepare(
"SELECT gedcom_id, setting_value FROM `##gedcom_setting` WHERE setting_name='SHOW_RELATIVES_EVENTS'"
)->fetchAssoc();
diff --git a/includes/db_schema/db_schema_6_7.php b/includes/db_schema/db_schema_6_7.php
index 82dc89bfad..44e6722b38 100644
--- a/includes/db_schema/db_schema_6_7.php
+++ b/includes/db_schema/db_schema_6_7.php
@@ -26,13 +26,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
try {
- self::exec(
+ WT_DB::exec(
"DROP TABLE `##remotelinks`"
);
} catch (PDOException $ex) {
@@ -40,7 +35,7 @@ try {
}
try {
- self::exec(
+ WT_DB::exec(
"ALTER TABLE `##sources` DROP INDEX ix2"
);
} catch (PDOException $ex) {
@@ -48,7 +43,7 @@ try {
}
try {
- self::exec(
+ WT_DB::exec(
"ALTER TABLE `##sources` DROP COLUMN s_dbid"
);
} catch (PDOException $ex) {
@@ -57,4 +52,3 @@ try {
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_7_8.php b/includes/db_schema/db_schema_7_8.php
index 66d38b748a..5dd4cb3a93 100644
--- a/includes/db_schema/db_schema_7_8.php
+++ b/includes/db_schema/db_schema_7_8.php
@@ -26,21 +26,15 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-self::exec(
+WT_DB::exec(
"UPDATE `##gedcom_setting` SET setting_value=TRIM(LEADING 'themes/' FROM TRIM(TRAILING '/' FROM setting_value)) WHERE setting_name='THEME_DIR'"
);
-self::exec(
+WT_DB::exec(
"UPDATE `##user_setting` SET setting_value=TRIM(LEADING 'themes/' FROM TRIM(TRAILING '/' FROM setting_value)) WHERE setting_name='THEME_DIR'"
);
-self::exec(
+WT_DB::exec(
"UPDATE `##user_gedcom_setting` SET setting_value=TRIM(LEADING 'themes/' FROM TRIM(TRAILING '/' FROM setting_value)) WHERE setting_name='THEME_DIR'"
);
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_8_9.php b/includes/db_schema/db_schema_8_9.php
index d9c256ca9b..b78e7efa40 100644
--- a/includes/db_schema/db_schema_8_9.php
+++ b/includes/db_schema/db_schema_8_9.php
@@ -26,13 +26,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
try {
- self::exec(
+ WT_DB::exec(
"ALTER TABLE `##dates` CHANGE d_type d_type ENUM('@#DGREGORIAN@', '@#DJULIAN@', '@#DHEBREW@', '@#DFRENCH R@', '@#DHIJRI@', '@#DROMAN@', '@#DJALALI@')"
);
} catch (PDOException $ex) {
@@ -41,4 +36,3 @@ try {
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/includes/db_schema/db_schema_9_10.php b/includes/db_schema/db_schema_9_10.php
index 1bf10b1394..3cc6910b56 100644
--- a/includes/db_schema/db_schema_9_10.php
+++ b/includes/db_schema/db_schema_9_10.php
@@ -26,15 +26,10 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// A bug in the original version of db_schema_8_9 failed to update this :-(
// Do it again....
try {
- self::exec(
+ WT_DB::exec(
"ALTER TABLE `##dates` CHANGE d_type d_type ENUM('@#DGREGORIAN@', '@#DJULIAN@', '@#DHEBREW@', '@#DFRENCH R@', '@#DHIJRI@', '@#DROMAN@', '@#DJALALI@')"
);
} catch (PDOException $ex) {
@@ -44,7 +39,7 @@ try {
try {
// The INDILIST and FAMLIST scripts have been rewritten to use this index
- self::exec(
+ WT_DB::exec(
"ALTER TABLE `##name` DROP INDEX ix2, ADD INDEX ix2 (n_surn, n_file, n_type, n_id), ADD INDEX ix3 (n_givn, n_file, n_type, n_id)"
);
} catch (PDOException $ex) {
@@ -53,4 +48,3 @@ try {
// Update the version to indicate success
WT_Site::setPreference($schema_name, $next_version);
-
diff --git a/modules_v3/gedcom_favorites/db_schema/db_schema_0_1.php b/modules_v3/gedcom_favorites/db_schema/db_schema_0_1.php
index 95c2f8c8ae..82dacab5f7 100644
--- a/modules_v3/gedcom_favorites/db_schema/db_schema_0_1.php
+++ b/modules_v3/gedcom_favorites/db_schema/db_schema_0_1.php
@@ -31,11 +31,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
WT_DB::exec(
"CREATE TABLE IF NOT EXISTS `##favorites` (".
" fv_id INTEGER AUTO_INCREMENT NOT NULL,".
diff --git a/modules_v3/gedcom_favorites/db_schema/db_schema_1_2.php b/modules_v3/gedcom_favorites/db_schema/db_schema_1_2.php
index 9a2c111c1e..5706534f21 100644
--- a/modules_v3/gedcom_favorites/db_schema/db_schema_1_2.php
+++ b/modules_v3/gedcom_favorites/db_schema/db_schema_1_2.php
@@ -25,11 +25,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Add the new columns
try {
WT_DB::exec(
diff --git a/modules_v3/gedcom_favorites/db_schema/db_schema_2_3.php b/modules_v3/gedcom_favorites/db_schema/db_schema_2_3.php
index eaa1a743a0..a86d1f4447 100644
--- a/modules_v3/gedcom_favorites/db_schema/db_schema_2_3.php
+++ b/modules_v3/gedcom_favorites/db_schema/db_schema_2_3.php
@@ -26,11 +26,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Delete any data that might violate the new constraints
WT_DB::exec(
"DELETE FROM `##favorite`".
diff --git a/modules_v3/gedcom_favorites/db_schema/db_schema_3_4.php b/modules_v3/gedcom_favorites/db_schema/db_schema_3_4.php
index 881bade6ff..4fb961fbdd 100644
--- a/modules_v3/gedcom_favorites/db_schema/db_schema_3_4.php
+++ b/modules_v3/gedcom_favorites/db_schema/db_schema_3_4.php
@@ -26,11 +26,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Add the new constraints
try {
WT_DB::exec("ALTER TABLE `##favorite` CHANGE note note VARCHAR(1000) NULL");
diff --git a/modules_v3/gedcom_news/db_schema/db_schema_0_1.php b/modules_v3/gedcom_news/db_schema/db_schema_0_1.php
index 74498479af..873ce7f8fa 100644
--- a/modules_v3/gedcom_news/db_schema/db_schema_0_1.php
+++ b/modules_v3/gedcom_news/db_schema/db_schema_0_1.php
@@ -28,11 +28,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
WT_DB::exec(
"CREATE TABLE IF NOT EXISTS `##news` (".
" n_id INTEGER AUTO_INCREMENT NOT NULL,".
diff --git a/modules_v3/gedcom_news/db_schema/db_schema_1_2.php b/modules_v3/gedcom_news/db_schema/db_schema_1_2.php
index f7347ccd3a..ce0ed30d8b 100644
--- a/modules_v3/gedcom_news/db_schema/db_schema_1_2.php
+++ b/modules_v3/gedcom_news/db_schema/db_schema_1_2.php
@@ -25,11 +25,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Add new columns
try {
WT_DB::exec(
diff --git a/modules_v3/gedcom_news/db_schema/db_schema_2_3.php b/modules_v3/gedcom_news/db_schema/db_schema_2_3.php
index 5b391c859a..ac0162503f 100644
--- a/modules_v3/gedcom_news/db_schema/db_schema_2_3.php
+++ b/modules_v3/gedcom_news/db_schema/db_schema_2_3.php
@@ -26,11 +26,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Delete any data that might violate the new constraints
WT_DB::exec(
"DELETE FROM `##news`".
diff --git a/modules_v3/googlemap/db_schema/db_schema_0_1.php b/modules_v3/googlemap/db_schema/db_schema_0_1.php
index 0cc19a33f5..b718f63392 100644
--- a/modules_v3/googlemap/db_schema/db_schema_0_1.php
+++ b/modules_v3/googlemap/db_schema/db_schema_0_1.php
@@ -28,11 +28,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Create all of the tables needed for this module
WT_DB::exec(
"CREATE TABLE IF NOT EXISTS `##placelocation` (".
diff --git a/modules_v3/googlemap/db_schema/db_schema_1_2.php b/modules_v3/googlemap/db_schema/db_schema_1_2.php
index 1f3755e70d..15592381dd 100644
--- a/modules_v3/googlemap/db_schema/db_schema_1_2.php
+++ b/modules_v3/googlemap/db_schema/db_schema_1_2.php
@@ -29,11 +29,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Create all of the tables needed for this module
try {
WT_DB::exec(
diff --git a/modules_v3/googlemap/db_schema/db_schema_2_3.php b/modules_v3/googlemap/db_schema/db_schema_2_3.php
index c2fc45fc82..84717ac393 100644
--- a/modules_v3/googlemap/db_schema/db_schema_2_3.php
+++ b/modules_v3/googlemap/db_schema/db_schema_2_3.php
@@ -27,11 +27,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
WT_DB::exec("UPDATE `##placelocation` SET pl_icon=REPLACE(pl_icon, '.gif', '.png')");
// Update the version to indicate success
diff --git a/modules_v3/googlemap/db_schema/db_schema_3_4.php b/modules_v3/googlemap/db_schema/db_schema_3_4.php
index e705b60d42..690603a912 100644
--- a/modules_v3/googlemap/db_schema/db_schema_3_4.php
+++ b/modules_v3/googlemap/db_schema/db_schema_3_4.php
@@ -27,15 +27,11 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-self::exec(
+WT_DB::exec(
"UPDATE `##module` m, `##module_setting` ms SET m.status=CASE WHEN (m.status=1 AND ms.setting_value=1) THEN 'enabled' ELSE 'disabled' END WHERE m.module_name=ms.module_name AND m.module_name='googlemap' AND ms.setting_name='GM_ENABLED'"
);
-self::exec(
+
+WT_DB::exec(
"DELETE FROM `##module_setting` WHERE module_name='googlemap' AND setting_name='GM_ENABLED'"
);
diff --git a/modules_v3/googlemap/db_schema/db_schema_4_5.php b/modules_v3/googlemap/db_schema/db_schema_4_5.php
index 0e43dd605c..2b3ef51041 100644
--- a/modules_v3/googlemap/db_schema/db_schema_4_5.php
+++ b/modules_v3/googlemap/db_schema/db_schema_4_5.php
@@ -27,12 +27,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-self::exec(
+WT_DB::exec(
"DELETE FROM `##module_setting` WHERE module_name='googlemap' AND setting_name IN (
'GM_API_KEY', 'GM_DEFAULT_TOP_VALUE', 'GM_DISP_COUNT', 'GM_MAX_NOF_LEVELS', 'GM_PH_CONTROLS', 'GM_PH_WHEEL', 'GM_PRE_POST_MODE_1', 'GM_PRE_POST_MODE_2', 'GM_PRE_POST_MODE_3', 'GM_PRE_POST_MODE_4', 'GM_PRE_POST_MODE_5', 'GM_PRE_POST_MODE_6', 'GM_PRE_POST_MODE_7', 'GM_PRE_POST_MODE_8', 'GM_PRE_POST_MODE_9')"
);
diff --git a/modules_v3/user_blog/db_schema/db_schema_0_1.php b/modules_v3/user_blog/db_schema/db_schema_0_1.php
index 4fc62ba496..77926052e4 100644
--- a/modules_v3/user_blog/db_schema/db_schema_0_1.php
+++ b/modules_v3/user_blog/db_schema/db_schema_0_1.php
@@ -28,11 +28,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
WT_DB::exec(
"CREATE TABLE IF NOT EXISTS `##news` (".
" n_id INTEGER AUTO_INCREMENT NOT NULL,".
diff --git a/modules_v3/user_blog/db_schema/db_schema_1_2.php b/modules_v3/user_blog/db_schema/db_schema_1_2.php
index bba5f481db..8645cb333d 100644
--- a/modules_v3/user_blog/db_schema/db_schema_1_2.php
+++ b/modules_v3/user_blog/db_schema/db_schema_1_2.php
@@ -25,11 +25,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Add new columns
try {
WT_DB::exec(
diff --git a/modules_v3/user_blog/db_schema/db_schema_2_3.php b/modules_v3/user_blog/db_schema/db_schema_2_3.php
index 5b391c859a..ac0162503f 100644
--- a/modules_v3/user_blog/db_schema/db_schema_2_3.php
+++ b/modules_v3/user_blog/db_schema/db_schema_2_3.php
@@ -26,11 +26,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
// Delete any data that might violate the new constraints
WT_DB::exec(
"DELETE FROM `##news`".