3 if (!class_exists(
'ProtectorRegistry'))
exit(
'Registry not found');
11 eval(
' function xoops_module_uninstall_'.
$mydirname.
'( $module ) { return protector_onuninstall_base( $module , "'.
$mydirname.
'" ) ; } ' ) ;
14 if( ! function_exists(
'protector_onuninstall_base' ) ) {
23 if( defined(
'XOOPS_CUBE_LEGACY' ) ) {
24 $root =& XCube_Root::getSingleton();
25 $root->mDelegateManager->add(
'Legacy.Admin.Event.ModuleUninstall.' . ucfirst(
$mydirname) .
'.Success' ,
'protector_message_append_onuninstall' ) ;
28 if( ! is_array( $ret ) ) $ret = array() ;
35 $sql_file_path = dirname(__FILE__).
'/sql/mysql.sql' ;
37 if( file_exists( $sql_file_path ) ) {
38 $ret[] =
"SQL file found at <b>".htmlspecialchars($sql_file_path).
"</b>.<br /> Deleting tables...<br />";
39 $sql_lines = file( $sql_file_path ) ;
40 foreach( $sql_lines as $sql_line ) {
41 if( preg_match(
'/^CREATE TABLE \`?([a-zA-Z0-9_-]+)\`? /i' , $sql_line , $regs ) ) {
42 $sql =
'DROP TABLE '.addslashes($prefix_mod.
'_'.$regs[1]);
44 $ret[] =
'<span style="color:#ff0000;">ERROR: Could not drop table <b>'.htmlspecialchars($prefix_mod.
'_'.$regs[1]).
'<b>.</span><br />';
46 $ret[] =
'Table <b>'.htmlspecialchars($prefix_mod.
'_'.$regs[1]).
'</b> dropped.<br />';
72 function protector_message_append_onuninstall( &$module_obj , &$log )
75 foreach(
$GLOBALS[
'ret'] as $message ) {
76 $log->add( strip_tags( $message ) ) ;