Changeset 188
- Timestamp:
- Apr 21, 2009, 12:51:44 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/onuninstall.php
r1 r188 24 24 $db =& Database::getInstance() ; 25 25 $mid = $module->getVar('mid') ; 26 /* 27 // TABLES (loading mysql.sql) 28 $sql_file_path = dirname(__FILE__).'/sql/mysql.sql' ; 29 $prefix_mod = $db->prefix() . '_' . $mydirname ; 30 if( file_exists( $sql_file_path ) ) { 31 $ret[] = "SQL file found at <b>".htmlspecialchars($sql_file_path)."</b>.<br /> Deleting tables...<br />"; 32 $sql_lines = file( $sql_file_path ) ; 33 foreach( $sql_lines as $sql_line ) { 34 if( preg_match( '/^CREATE TABLE \`?([a-zA-Z0-9_-]+)\`? /i' , $sql_line , $regs ) ) { 35 $sql = 'DROP TABLE '.$prefix_mod.'_'.$regs[1] ; 36 if (!$db->query($sql)) { 37 $ret[] = '<span style="color:#ff0000;">ERROR: Could not drop table <b>'.htmlspecialchars($prefix_mod.'_'.$regs[1]).'<b>.</span><br />'; 38 } else { 39 $ret[] = 'Table <b>'.htmlspecialchars($prefix_mod.'_'.$regs[1]).'</b> dropped.<br />'; 40 } 26 27 $xp_prefix = $mydirname; 28 if ($xp_prefix == 'wordpress'){ 29 $xp_prefix = 'wp'; 30 } 31 32 $xoops_prefix = $db->prefix(); 33 34 if (empty($xoops_prefix) || empty($xp_prefix)) { 35 $ret[] = '<span style="color:#ff0000;">ERROR: Empty Prefix.</span><br />'; 36 return false; 37 } 38 39 $prefix_mod = $xoops_prefix . '_' . $xp_prefix; 40 $sql = "SHOW TABLES LIKE '$prefix_mod%'"; 41 if ($result = $db->query($sql)) { 42 while ($table = $db->fetchRow($result)){ 43 $drop_sql = 'DROP TABLE '. $table[0] ; 44 if (!$db->queryF($drop_sql)) { 45 $ret[] = '<span style="color:#ff0000;">ERROR: Could not drop table <b>'.htmlspecialchars($table[0]).'<b>.</span><br />'; 46 } else { 47 $ret[] = 'Table <b>'.htmlspecialchars($table[0]).'</b> dropped.<br />'; 41 48 } 42 49 } 50 } else { 51 $ret[] = '<span style="color:#ff0000;">ERROR: Table not found of prefix <b>'.htmlspecialchars($prefix_mod).'<b> .</span><br />'; 52 return false; 43 53 } 44 */ 54 55 45 56 // TEMPLATES (Not necessary because modulesadmin removes all templates) 46 57 /* $tplfile_handler =& xoops_gethandler( 'tplfile' ) ; -
trunk/xoops_version.php
r186 r188 40 40 41 41 // status 42 $modversion['codename'] = "Bata3(r18 6)";42 $modversion['codename'] = "Bata3(r188)"; 43 43 44 44 // onInstall, onUpdate, onUninstall … … 55 55 } 56 56 57 $modversion['tables'] = array( 58 $db_prefix . "_comments", 59 $db_prefix . "_links", 60 $db_prefix . "_options", 61 $db_prefix . "_postmeta", 62 $db_prefix . "_posts", 63 $db_prefix . "_users", 64 $db_prefix . "_usermeta", 65 $db_prefix . "_terms", 66 $db_prefix . "_term_relationships", 67 $db_prefix . "_term_taxonomy", 68 $db_prefix . "_views", 69 $db_prefix . "_d3forum_link", 70 $db_prefix . "_group_role" 71 ); 57 /* 58 * Table information is not described. 59 * 60 * The create of the table is do with oninstall.php. 61 * The drop of the table is do with onuninstall.php. 62 * 63 * $modversion['tables'] = array( ,,,); 64 */ 72 65 73 66
Note: See TracChangeset
for help on using the changeset viewer.