2 of 2 added 146 characters in body

Does plugin's uninstall.php file have access to the plugin 's object?

I read on the codex that the best way to implement a clean uninstallation functionality to a plugin is by adding a uninstall.php file inside your plugin directory.

I'm wondering: can i use my plugin's Class instance data inside the uninstall.php file?

This is the code sitting in my uninstall.php file:

if(!defined('WP_UNINSTALL_PLUGIN')) exit;
$table_name = $wpdb->prefix . $this->dbName;
$wpdb->query("DROP TABLE `$table_name`");

I'm wondering if the table_name variable will be properly retrieved, or if i should hardcode it.

As per my tests, the table remains after deletion, so i guess i'l fallback to using a hook inside my plugin's file, unless i'm missing something?