Example #1
0
function main()
{
    if ($_SERVER['argc'] > 1) {
        $option = $_SERVER['argv'][1];
    } else {
        help();
    }
    switch ($option) {
        case "install":
            install();
            break;
        case "uninstall":
            uninstall();
            break;
        case "newapp":
            $_SERVER['argc'] != 3 and help();
            newapp($_SERVER['argv'][2]);
            break;
        case "delapp":
            $_SERVER['argc'] != 3 and help();
            delapp($_SERVER['argv'][2]);
            break;
        case "help":
            help();
            break;
        default:
            help();
            break;
    }
}
function uninstall(&$STACK, $addon)
{
    $INSTALLED = array();
    $STACK->rewind();
    foreach ($STACK as $item) {
        $INSTALLED[] = $item;
    }
    // Check dependencies for this $addon - recurse if necessary
    $dependencies = SchemesManager::getUninstallDependencies($addon);
    if (!empty($dependencies)) {
        foreach ($dependencies as $shortcode => $name) {
            // print "$addon depends on $shortcode\n";
            if (!in_array($shortcode, $INSTALLED)) {
                uninstall($STACK, $shortcode);
            } else {
                echo "warning: {$addon} already uninstalled\n";
            }
        }
    }
    if (!isset($INSTALLED) || !in_array($addon, $INSTALLED)) {
        $result = fn_uninstall_addon($addon, true);
        if (empty($result)) {
            echo "could not uninstall '{$addon}' - aborting...\n\n";
            echo "Re-installing previously uninstalled addons to restore system to good state\n";
            foreach ($STACK as $item) {
                $addon = $STACK->pop();
                fn_install_addon($addon, true, false);
                fn_update_addon_status($addon, 'A', true, false);
                print "INSTALL: {$addon}\n";
            }
            exit;
        }
        echo "UNINSTALL: {$addon}\n";
        $STACK->push($addon);
    }
}
Example #3
0
<?php

global $wp_version;
if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) {
    die('You are not allowed to call this page directly.');
}
if (isset($_POST['Uninstall'])) {
    uninstall();
} else {
}
function uninstall()
{
    /*
    	global $wpdb;
    
    	$meta_query = "DELETE FROM $wpdb->postmeta WHERE meta_key LIKE '" . LIBSYN_KEY . "%';";
    	$option_query = "DELETE FROM $wpdb->options WHERE option_name LIKE '" . LIBSYN_KEY . "%';";
    	$post_query = "DELETE FROM $wpdb->posts WHERE post_type = 'jw_playlist';";
    
    	$wpdb->query($meta_query);
    	$wpdb->query($option_query);
    	$wpdb->query($post_query);
    
    	@unlink(LongTailFramework::getPlayerPath());
    	@unlink(LongTailFramework::getEmbedderPath());
    	@rmdir(JWPLAYER_FILES_DIR . "/player/");
    
    	$handler = @opendir(JWPLAYER_FILES_DIR . "/configs");
    	if ($handler) {
    	while ($file = readdir($handler)) {
    	  if ($file != "." && $file != ".." && strstr($file, ".xml")) {
Example #4
0
 /**
  * Install, uninstall, or upgrade a module. This calls the init file in a module and runs one of the following functions:
  * install(), uninstall(), or upgrade().
  *
  * @param 	int $id
  * @param 	string $action
  *
  */
 function init_module($id, $action, $msg = '')
 {
     $directory = $this->get_module($id);
     if (!$directory) {
         return false;
     }
     if ($this->exists($directory['directory'], '/init.php')) {
         require_once $this->modules_dir . '/' . $directory['directory'] . '/init.php';
     }
     if ($action == "deactivate") {
         if (function_exists('uninstall')) {
             $msg = uninstall();
         }
         $this->db->delete('modules', array('id' => $id));
         return $msg;
     } elseif ($action == "upgrade") {
         if (function_exists('upgrade')) {
             upgrade();
         }
         if ($this->exists($directory['directory'])) {
             $data = $this->get_config($directory['directory']);
             $module_data = array('name' => $data['module']['name'], 'displayname' => $data['module']['displayname'], 'description' => $data['module']['description'], 'directory' => $data['module']['name'], 'version' => $data['module']['version'], 'active' => 1);
             $this->db->where('id', $id);
             $this->db->update('modules', $module_data);
             $this->db->cache_delete_all();
         }
     } else {
         if (function_exists('install')) {
             install();
         }
     }
 }
Example #5
0
}
switch ($cmd) {
    case 'list':
        list_plugins();
        break;
    case 'clean':
        clean();
        break;
    case 'reload':
        reload();
        break;
    case 'install':
        install($argv[2]);
        break;
    case 'uninstall':
        uninstall($argv[2]);
        break;
    case 'enable':
        enable($argv[2]);
        break;
    case 'disable':
        disable($argv[2]);
        break;
    case 'update':
        update($argv[2]);
        break;
    case 'check':
        break;
    default:
        print 'Unknown command ' . $cmd . "\n";
}
Example #6
0
 /**
  * Uninstaller::_uninstallModule()
  * 
  * @return
  */
 public function _uninstallModule()
 {
     $this->parent->parent->debug($this::name_space . ': Finding uninstall.php...');
     if (!file_exists($this->module_dir . '/uninstall.php')) {
         return new ActionResult($this, '/admin/modules/uninstall/', 0, 'Unregistering groups...', B_T_FAIL, array('status' => 1, 'msg' => 'Unregistering groups...'));
     }
     if (!@(include_once $this->module_dir . '/uninstall.php')) {
         return new ActionResult($this, '/admin/modules/uninstall/', 0, 'Failed to process module uninstaller!', B_T_FAIL, array('status' => 0, 'msg' => 'Failed to process module uninstaller!'));
     }
     $this->parent->parent->debug($this::name_space . ': Found uninstall.php!');
     $this->parent->parent->debug($this::name_space . ': Installing..');
     if (!is_callable('uninstall')) {
         $this->parent->parent->debug($this::name_space . ': Couldn\'t find uninstall()!');
         return new ActionResult($this, '/admin/modules/uninstall/', 0, 'Unregistering groups...', B_T_FAIL, array('status' => 1, 'msg' => 'Unregistering groups...'));
     }
     if (uninstall($this)) {
         $this->parent->parent->debug($this::name_space . ': Uninstalled!');
         return new ActionResult($this, '/admin/modules/uninstall/', 0, 'Unregistering groups...', B_T_FAIL, array('status' => 1, 'msg' => 'Unregistering groups...'));
     }
     $this->parent->parent->debug($this::name_space . ': Failed...');
     return new ActionResult($this, '/admin/modules/uninstall/', 0, 'Failed to process module uninstaller!', B_T_FAIL, array('status' => 0, 'msg' => 'Failed to process module uninstaller!'));
 }