Changeset 429550
- Timestamp:
- 08/27/2011 08:52:13 PM (15 years ago)
- Location:
- post-miner/trunk
- Files:
-
- 1 added
- 3 edited
-
PostMiner/Hooks.php (modified) (1 diff)
-
PostMiner/Installer.php (modified) (3 diffs)
-
PostMiner/Plugin.php (modified) (1 diff)
-
uninstall.php (added)
Legend:
- Unmodified
- Added
- Removed
-
post-miner/trunk/PostMiner/Hooks.php
r429538 r429550 46 46 PostMiner_Installer::install(); 47 47 } 48 49 50 /** 51 * PostMiner uninstall hook 52 * 53 * @todo drop PostMiner tables on uninstall 54 * 55 * @return void 56 */ 57 public function hookUninstall() 58 { 59 if ( !current_user_can('delete_plugins') ) 60 { 61 wp_die('Insufficient permissions'); 62 } 63 64 require_once POST_MINER__PATH . 'Installer.php'; 65 66 PostMiner_Installer::uninstall(); 67 } 48 68 49 69 50 /** -
post-miner/trunk/PostMiner/Installer.php
r429538 r429550 53 53 static function install() 54 54 { 55 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );56 55 require_once( POST_MINER__PATH . 'Indexer.php' ); 57 56 … … 60 59 $prefix = $wpdb->prefix . 'postminer'; 61 60 62 dbDelta( sprintf( self::$SQL_TERMS, $prefix ) );63 dbDelta( sprintf( self::$SQL_TERMS_RELATION, $prefix ) );61 $wpdb->get_request( sprintf( self::$SQL_TERMS, $prefix ) ); 62 $wpdb->get_request( sprintf( self::$SQL_TERMS_RELATION, $prefix ) ); 64 63 65 64 add_option("post-miner_db_version", '1.0.0'); … … 80 79 static function uninstall() 81 80 { 82 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );83 require_once( POST_MINER__PATH . 'Indexer.php' );84 85 81 global $wpdb; 86 82 87 83 $prefix = $wpdb->prefix . 'postminer'; 88 84 89 dbDelta( sprintf( self::$SQL_DROP_TERMS, $prefix ) );90 dbDelta( sprintf( self::$SQL_DROP_TERMS_RELATION, $prefix ) );85 $wpdb->get_request( sprintf( self::$SQL_DROP_TERMS, $prefix ) ); 86 $wpdb->get_request( sprintf( self::$SQL_DROP_TERMS_RELATION, $prefix ) ); 91 87 92 88 delete_option("post-miner_db_version"); -
post-miner/trunk/PostMiner/Plugin.php
r429538 r429550 62 62 } 63 63 64 /**65 * register activation/uninstall hooks66 */67 64 if( method_exists( $this->hooks, 'hookActivation' ) ) 68 65 { 69 66 register_activation_hook( POST_MINER__FILE, array( $this, '_hookActivation') ); 70 67 } 71 72 if( method_exists( $this->hooks, 'hookUninstall' ) ) 73 { 74 register_uninstall_hook( POST_MINER__FILE, array( $this, '_hookUninstall') ); 75 } 68 76 69 } 77 70
Note: See TracChangeset
for help on using the changeset viewer.