Ejemplo n.º 1
0
 static function uninstall($path)
 {
     $conn = getConnection();
     $conn->autocommit(false);
     try {
         $data['s_value'] = osc_installed_plugins();
         $plugins_list = unserialize($data['s_value']);
         Plugins::deactivate($path);
         $path = str_replace(osc_plugins_path(), '', $path);
         if (is_array($plugins_list)) {
             foreach ($plugins_list as $key => $value) {
                 if ($value == $path) {
                     unset($plugins_list[$key]);
                 }
             }
             $data['s_value'] = serialize($plugins_list);
             $condition = array('s_section' => 'osclass', 's_name' => 'installed_plugins');
             Preference::newInstance()->update($data, $condition);
             unset($condition);
             unset($data);
             $conn->commit();
             $plugin = Plugins::getInfo($path);
             Plugins::cleanCategoryFromPlugin($plugin['short_name']);
         }
     } catch (Exception $e) {
         $conn->rollback();
         echo $e->getMessage();
     }
     $conn->autocommit(true);
 }
Ejemplo n.º 2
0
 static function uninstall($path)
 {
     $data['s_value'] = osc_installed_plugins();
     $plugins_list = unserialize($data['s_value']);
     $path = str_replace(osc_plugins_path(), '', $path);
     if (!is_array($plugins_list)) {
         return false;
     }
     if (!self::deactivate($path)) {
         return false;
     }
     self::runHook($path . '_uninstall');
     foreach ($plugins_list as $k => $v) {
         if ($v == $path) {
             unset($plugins_list[$k]);
         }
     }
     $data['s_value'] = serialize($plugins_list);
     $condition = array('s_section' => 'osclass', 's_name' => 'installed_plugins');
     Preference::newInstance()->update($data, $condition);
     $plugin = self::getInfo($path);
     self::cleanCategoryFromPlugin($plugin['short_name']);
     return true;
 }
Ejemplo n.º 3
0
 static function uninstall($path)
 {
     $data['s_value'] = osc_installed_plugins();
     $plugins_list = unserialize($data['s_value']);
     $path = str_replace(osc_plugins_path(), '', $path);
     if (!is_array($plugins_list)) {
         return false;
     }
     include_once osc_plugins_path() . $path;
     self::deactivate($path);
     /*if( !self::deactivate($path) ) {
           return false;
       }*/
     self::runHook($path . '_uninstall');
     foreach ($plugins_list as $k => $v) {
         if ($v == $path) {
             unset($plugins_list[$k]);
         }
     }
     osc_set_preference('installed_plugins', serialize($plugins_list));
     $plugin = self::getInfo($path);
     self::cleanCategoryFromPlugin($plugin['short_name']);
     return true;
 }