From 67c55c5a251a34f4fb517677ce5f8de4add14878 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 24 Jun 2010 07:26:49 +0000 Subject: [PATCH] - remove installed files when APS packages has been removed, fixes #273 refs #273 --- lib/classes/aps/class.ApsInstaller.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/classes/aps/class.ApsInstaller.php b/lib/classes/aps/class.ApsInstaller.php index 5ef7e4f8..4c16d335 100644 --- a/lib/classes/aps/class.ApsInstaller.php +++ b/lib/classes/aps/class.ApsInstaller.php @@ -219,11 +219,7 @@ class ApsInstaller extends ApsParser } elseif($Task == TASK_REMOVE) { - //FIXME cleanup installation - //remove files from: $this->RealPath . $this->DomainPath . '/' - //remove permissions - //drop database - + // check for database if ($this->aps_version == '1.0') { // the good ole way @@ -240,7 +236,7 @@ class ApsInstaller extends ApsParser if($XmlDb->db->id) { - //database management + //drop database permissions $Database = 'web' . $Row['CustomerID'] . 'aps' . $Row['InstanceID']; foreach(array_map('trim', explode(',', $this->Hosts)) as $DatabaseHost) @@ -250,6 +246,7 @@ class ApsInstaller extends ApsParser $this->db_root->query('DELETE FROM `mysql`.`user` WHERE `User` = "' . $this->db->escape($Database) . '" AND `Host` = "' . $this->db->escape($DatabaseHost) . '"'); } + //drop database $this->db_root->query('DROP DATABASE IF EXISTS `' . $this->db->escape($Database) . '`'); $this->db_root->query('FLUSH PRIVILEGES'); @@ -265,6 +262,9 @@ class ApsInstaller extends ApsParser $this->db->query('DELETE FROM `' . TABLE_APS_TASKS . '` WHERE `Task` = ' . TASK_REMOVE . ' AND `InstanceID` = ' . $this->db->escape($Row['InstanceID'])); $this->db->query('DELETE FROM `' . TABLE_APS_INSTANCES . '` WHERE `ID` = ' . $this->db->escape($Row['InstanceID'])); $this->db->query('DELETE FROM `' . TABLE_APS_SETTINGS . '` WHERE `InstanceID` = ' . $this->db->escape($Row['InstanceID'])); + + //remove data, #273 + self::UnlinkRecursive($this->RealPath . $this->DomainPath . '/'); } } @@ -642,5 +642,3 @@ class ApsInstaller extends ApsParser return false; } } - -?> \ No newline at end of file