From 29e3c2eda22f7892d95ba2fef6ed36f78b855bd7 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Fri, 15 Apr 2016 19:52:21 -0600 Subject: [PATCH] Get the database connection for save_phrases_xml.php. --- app/phrases/resources/functions/save_phrases_xml.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/phrases/resources/functions/save_phrases_xml.php b/app/phrases/resources/functions/save_phrases_xml.php index 597971fedb..60625c7f86 100644 --- a/app/phrases/resources/functions/save_phrases_xml.php +++ b/app/phrases/resources/functions/save_phrases_xml.php @@ -5,8 +5,17 @@ function save_phrases_xml() { if (strlen($_SESSION['switch']['phrases']['dir']) == 0) { return; } + //declare the global variables - global $db, $domain_uuid, $config; + global $domain_uuid, $config; + + //connect to the database if not connected + if (!$db) { + require_once "resources/classes/database.php"; + $database = new database; + $database->connect(); + $db = $database->db; + } //remove old phrase files for the domain $phrase_list = glob($_SESSION['switch']['phrases']['dir']."/*/phrases/".$domain_uuid.".xml");