本文整理汇总了PHP中module::uninstall方法的典型用法代码示例。如果您正苦于以下问题:PHP module::uninstall方法的具体用法?PHP module::uninstall怎么用?PHP module::uninstall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module
的用法示例。
在下文中一共展示了module::uninstall方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: change
public function change()
{
access::verify_csrf();
$active_provider = module::get_var("gallery", "identity_provider", "user");
$providers = identity::providers();
$new_provider = Input::instance()->post("provider");
if ($new_provider != $active_provider) {
module::deactivate($active_provider);
// Switch authentication
identity::reset();
module::set_var("gallery", "identity_provider", $new_provider);
module::install($new_provider);
module::activate($new_provider);
module::event("identity_provider_changed", $active_provider, $new_provider);
module::uninstall($active_provider);
message::success(t("Changed to %description", array("description" => $providers->{$new_provider})));
try {
Session::instance()->destroy();
} catch (Exception $e) {
// We don't care if there was a problem destroying the session.
}
url::redirect(item::root()->abs_url());
}
message::info(t("The selected provider \"%description\" is already active.", array("description" => $providers->{$new_provider})));
url::redirect("admin/identity");
}
示例2: save
public function save()
{
foreach (module::available() as $module_name => $info) {
if ($info->locked) {
continue;
}
$desired = $this->input->post($module_name) == 1;
if ($info->installed && !$desired) {
module::uninstall($module_name);
message::success(t("Uninstalled %module_name module", array("module_name" => $info->name)));
} else {
if (!$info->installed && $desired) {
module::install($module_name);
message::success(t("Installed %module_name module", array("module_name" => $info->name)));
}
}
}
url::redirect("admin/modules");
}
示例3: uninstall
/**
* Uninstall
*
* Module uninstall routine
*
* @access public
*/
function uninstall()
{
SQLExec('DROP TABLE IF EXISTS commands');
parent::uninstall();
}
示例4: uninstall
/**
* Uninstall
*
* Module uninstall routine
*
* @access public
*/
function uninstall()
{
SQLExec('DROP TABLE IF EXISTS zwave_devices');
SQLExec('DROP TABLE IF EXISTS zwave_properties');
parent::uninstall();
}
示例5: uninstall
/**
* Uninstall
*
* Module uninstall routine
*
* @access public
*/
function uninstall() {
SQLExec('DROP TABLE IF EXISTS terminals');
parent::uninstall();
}
示例6: uninstall
public function uninstall()
{
return parent::uninstall();
}
示例7: uninstall
/**
* Uninstall
*
* Module uninstall routine
*
* @access public
*/
function uninstall()
{
SQLExec('DROP TABLE IF EXISTS tlg_user_cmd');
SQLExec('DROP TABLE IF EXISTS tlg_user');
SQLExec('DROP TABLE IF EXISTS tlg_cmd');
parent::uninstall();
}
示例8: change_provider
static function change_provider($new_provider)
{
if (!identity::active_user()->admin && PHP_SAPI != "cli") {
// Below, the active user is set to the primary admin.
access::forbidden();
}
$current_provider = module::get_var("gallery", "identity_provider");
if (!empty($current_provider)) {
module::uninstall($current_provider);
}
try {
IdentityProvider::reset();
$provider = new IdentityProvider($new_provider);
module::set_var("gallery", "identity_provider", $new_provider);
if (method_exists("{$new_provider}_installer", "initialize")) {
call_user_func("{$new_provider}_installer::initialize");
}
module::event("identity_provider_changed", $current_provider, $new_provider);
identity::set_active_user($provider->admin_user());
Session::instance()->regenerate();
} catch (Exception $e) {
static $restore_already_running;
// In case of error, make an attempt to restore the old provider. Since that's calling into
// this function again and can fail, we should be sure not to get into an infinite recursion.
if (!$restore_already_running) {
$restore_already_running = true;
// Make sure new provider is not in the database
try {
module::uninstall($new_provider);
// Lets reset to the current provider so that the gallery installation is still
// working.
module::set_var("gallery", "identity_provider", null);
IdentityProvider::change_provider($current_provider);
module::activate($current_provider);
} catch (Exception $e2) {
Kohana_Log::add("error", "Error restoring original identity provider\n" . $e2->getMessage() . "\n" . $e2->getTraceAsString());
}
message::error(t("Error attempting to enable \"%new_provider\" identity provider, reverted to \"%old_provider\" identity provider", array("new_provider" => $new_provider, "old_provider" => $current_provider)));
$restore_already_running = false;
}
throw $e;
}
}
示例9: uninstall
/**
* Uninstall
*
* Module uninstall routine
*
* @access public
*/
function uninstall()
{
SQLExec('DROP TABLE IF EXISTS scenes');
SQLExec('DROP TABLE IF EXISTS elements');
SQLExec('DROP TABLE IF EXISTS elm_states');
parent::uninstall();
}
示例10: uninstall
/**
* Uninstall
*
* Module uninstall routine
*
* @access public
*/
function uninstall()
{
SQLExec('DROP TABLE IF EXISTS gpslog');
SQLExec('DROP TABLE IF EXISTS gpslocations');
SQLExec('DROP TABLE IF EXISTS gpsdevices');
SQLExec('DROP TABLE IF EXISTS gpsactions');
parent::uninstall();
}
示例11: change_provider
static function change_provider($new_provider)
{
$current_provider = module::get_var("gallery", "identity_provider");
if (!empty($current_provider)) {
module::uninstall($current_provider);
}
try {
IdentityProvider::reset();
$provider = new IdentityProvider($new_provider);
module::set_var("gallery", "identity_provider", $new_provider);
if (method_exists("{$new_provider}_installer", "initialize")) {
call_user_func("{$new_provider}_installer::initialize");
}
module::event("identity_provider_changed", $current_provider, $new_provider);
auth::login($provider->admin_user());
Session::instance()->regenerate();
} catch (Exception $e) {
static $restore_already_running;
// In case of error, make an attempt to restore the old provider. Since that's calling into
// this function again and can fail, we should be sure not to get into an infinite recursion.
if (!$restore_already_running) {
$restore_already_running = true;
// Make sure new provider is not in the database
module::uninstall($new_provider);
// Lets reset to the current provider so that the gallery installation is still
// working.
module::set_var("gallery", "identity_provider", null);
IdentityProvider::change_provider($current_provider);
module::activate($current_provider);
message::error(t("Error attempting to enable \"%new_provider\" identity provider, " . "reverted to \"%old_provider\" identity provider", array("new_provider" => $new_provider, "old_provider" => $current_provider)));
$restore_already_running = false;
}
throw $e;
}
}