function __construct()
 {
     // remove obsolete files
     jimport('joomla.filesystem.file');
     jimport('joomla.filesystem.folder');
     $removeFiles = array();
     $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'js' . DS . 'jquery-1.4.2.min.js';
     $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'js' . DS . 'jquery.clockpick.1.2.7.min.js';
     $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'css' . DS . 'jquery.clockpick.1.2.7.css';
     $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'images' . DS . 'ol_bg.jpg';
     $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'models' . DS . 'archive.php';
     $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'controllers' . DS . 'archive.php';
     $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'models' . DS . 'suppression.php';
     $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'controllers' . DS . 'suppression.php';
     $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'helpers' . DS . 'cache.php';
     $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'images' . DS . 'templateEditor.png';
     $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'images' . DS . 'clearPosition.png';
     $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'images' . DS . 'apply.png';
     foreach ($removeFiles as $rf) {
         if (JFile::exists($rf)) {
             JFile::Delete($rf);
         }
     }
     // remove obsolete folders
     $removeFolders = array();
     $removeFolders[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'scripts';
     $removeFolders[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'views' . DS . 'archive';
     $removeFolders[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'views' . DS . 'suppression';
     foreach ($removeFolders as $rf) {
         if (JFolder::exists($rf)) {
             JFolder::Delete($rf);
         }
     }
     parent::__construct();
     $this->registerTask('install', 'install');
     $this->registerTask('upgrade', 'upgrade');
 }
Beispiel #2
0
<?php

/**
 * @package Joomla.JoomShopping.Products.List
 * @version 2.2.1
 * @author Linfuby (Meling Vadim)
 * @website http://dell3r.ru/
 * @email support@dell3r.ru
 * @copyright Copyright by Linfuby. All rights reserved.
 * @license The MIT License (MIT); See \components\com_jshopping\addons\jshopping_to_parent_category\license.txt
 */
defined('_JEXEC') or die;
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
$AddonAlias = "to_parent_category";
$PluginDirs = array("products");
$DataBase = JFactory::getDBO();
foreach ($PluginDirs as $Plugin) {
    $Query = $DataBase->getQuery(true);
    $Query->delete("#__extensions");
    $Query->where("element = '" . $AddonAlias . "'");
    $Query->where("folder = 'jshopping" . $Plugin . "'");
    $Query = (string) $Query;
    $DataBase->setQuery($Query);
    $DataBase->query();
    JFolder::Delete(JPATH_ROOT . "/plugins/jshopping" . $Plugin . "/extended_menu");
}
JFolder::Delete(JPATH_ROOT . "/components/com_jshopping/addons/jshopping_" . $AddonAlias);