| Server IP : 195.130.67.5 / Your IP : 216.73.216.231 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Old Sites/moke/administrator/components/com_myrssreader/ |
Upload File : |
<?php
/**
* @package My RSS Reader
* @copyright Copyright (C) 2010 FalsinSoft. All rights reserved.
* @license GNU/GPL
* @website http://falsinsoft.blogspot.com
* @email falsinsoft@gmail.com
*
*/
defined('_JEXEC') or die('Restricted access');
class com_MyRSSReaderInstallerScript
{
function install($parent)
{
$this->install_plugins($parent);
echo JText::_('COM_MYRSSREADER_INSTALL_TEXT');
}
function uninstall($parent)
{
$this->uninstall_plugins($parent);
}
function update($parent)
{
$this->install_plugins($parent);
echo JText::_('COM_MYRSSREADER_UPDATE_TEXT');
}
function preflight($type, $parent)
{
}
function postflight($type, $parent)
{
}
private function install_plugins($parent)
{
$db = JFactory::getDbo();
$manifest = $parent->get("manifest");
$parent = $parent->getParent();
$source = $parent->getPath("source");
$installer = new JInstaller();
foreach($manifest->plugins->plugin as $plugin)
{
$attributes = $plugin->attributes();
$plg = $source.DS.$attributes['folder'].DS.$attributes['plugin'];
$installer->install($plg);
}
$tableExtensions = $db->nameQuote("#__extensions");
$columnElement = $db->nameQuote("element");
$columnType = $db->nameQuote("type");
$columnEnabled = $db->nameQuote("enabled");
$db->setQuery("UPDATE ".$tableExtensions." SET ".$columnEnabled."=1 WHERE ".$columnElement."='myrssreader' AND ".$columnType."='plugin'");
$db->query();
}
private function uninstall_plugins($parent)
{
$db = JFactory::getDbo();
$db->setQuery("SELECT extension_id FROM #__extensions WHERE type='plugin' AND element ='myrssreader' LIMIT 1");
$result = $db->loadResult();
if($result)
{
$installer = new JInstaller();
$installer->uninstall('plugin', $result);
}
}
}