Changeset 4583

Show
Ignore:
Timestamp:
07/27/07 23:47:40 (1 year ago)
Author:
p_lindheimer
Message:

added proper uninstall script which removes all the feature codes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.3/miscapps/functions.inc.php

    r4579 r4583  
    5454                foreach (array_keys($results) as $idx) { 
    5555                        $fc = new featurecode('miscapps', 'miscapp_'.$results[$idx]['miscapps_id']); 
    56                         $results[$idx]['ext'] = $fc->getCode(); 
     56                        $results[$idx]['ext'] = $fc->getDefault(); 
    5757                        $results[$idx]['enabled'] = $fc->isEnabled(); 
    5858                } 
  • modules/branches/2.3/miscapps/module.xml

    r4581 r4583  
    22        <rawname>miscapps</rawname> 
    33        <name>Misc Applications</name> 
    4         <version>0.2.3</version> 
     4        <version>0.2.3.1</version> 
    55        <type>setup</type> 
    66        <category>Internal Options &amp; Configuration</category> 
     
    1212        </menuitems> 
    1313        <changelog> 
     14                *0.2.3.1* added proper uninstall, removes any feature codes and then table 
    1415                *0.2.3* #1902 miscapp always sets/pulls default code now regardless of custom override in featurecodes 
    1516                *0.2.2* added SQLite3 support, fixes http://freepbx.org/trac/ticket/1775 
  • modules/branches/2.3/miscapps/uninstall.php

    r4245 r4583  
    44global $amp_conf; 
    55 
    6 $autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT":"AUTO_INCREMENT"; 
    7 $sql = "CREATE TABLE IF NOT EXISTS miscapps ( 
    8         miscapps_id INTEGER NOT NULL PRIMARY KEY $autoincrement, 
    9         ext VARCHAR( 50 ) , 
    10         description VARCHAR( 50 ) , 
    11         dest VARCHAR( 255 ) 
    12 )"; 
    13  
    14 $check = $db->query($sql); 
    15 if(DB::IsError($check)) { 
    16         die("Can not create miscdests table\n"); 
    17 
    18 $results = array(); 
    19 $sql = "SELECT miscapps_id, dest FROM miscapps"; 
    20 $results = $db->getAll($sql, DB_FETCHMODE_ASSOC); 
    21 if (!DB::IsError($results)) { // error - table must not be there 
    22         foreach ($results as $result) { 
    23                 $old_dest    = $result['dest']; 
    24                 $miscapps_id = $result['miscapps_id']; 
    25  
    26                 $new_dest = merge_ext_followme(trim($old_dest)); 
    27                 if ($new_dest != $old_dest) { 
    28                         $sql = "UPDATE miscapps SET dest = '$new_dest' WHERE miscapps_id = $miscapps_id  AND dest = '$old_dest'"; 
    29                         $results = $db->query($sql); 
    30                         if(DB::IsError($results)) { 
    31                                 die($results->getMessage()); 
    32                         } 
    33                 } 
    34         } 
     6$miscapps_arr = miscapps_list(); 
     7foreach ($miscapps_arr as $item) { 
     8        echo "removing ".$item['description'].".."; 
     9        miscapps_delete($item['miscapps_id']); 
     10        echo "done<br>\n"; 
    3511} 
    3612 
     13echo "dropping table miscapps.."; 
     14sql("DROP TABLE IF EXISTS `miscapps`"); 
     15echo "done<br>\n"; 
     16 
    3717?> 
  • modules/branches/2.3/miscapps/uninstall.sql

    r4245 r4583  
    1 DROP TABLE IF EXISTS `miscapps`; 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads