public function doInstall() { // Try to include the file $file = 'administrator/components/com_magebridge/helpers/install.php'; if (is_file(JPATH_ROOT . '/' . $file)) { require_once JPATH_ROOT . '/' . $file; } else { if (is_file(dirname(__FILE__) . '/' . $file)) { require_once dirname(__FILE__) . '/' . $file; } else { return true; } } // Initialize the helper $helper = new MageBridgeInstallHelper(); // Initialize important variables $application = JFactory::getApplication(); $db = JFactory::getDBO(); // Remove obsolete files //$helper->cleanFiles(); // Upgrade the database tables $helper->updateQueries(); // Install new connectors $helper->installConnectors(); // Done return true; }
/** * Method run when installing MageBridge */ function com_install() { require_once dirname(__FILE__) . '/helpers/install.php'; $helper = new MageBridgeInstallHelper(); // Initialize important variables $application = JFactory::getApplication(); $db = JFactory::getDBO(); // Upgrade the database tables $helper->updateQueries(); // Done return true; }
/** * Method to perform update queries * * @param null * * @return null */ public function updateQueries() { // Validate whether this task is allowed if ($this->_validate() == false) { return false; } // Initialize the helper $helper = new MageBridgeInstallHelper(); // Upgrade the database tables $helper->updateQueries(); // Run the helper to remove obsolete files YireoHelperInstall::remove(); // Clean the Joomla! plugins cache $options = array('defaultgroup' => 'com_plugins', 'cachebase' => JPATH_ADMINISTRATOR . '/cache'); $cache = JCache::getInstance('callback', $options); $cache->clean(); // Redirect $link = 'index.php?option=com_magebridge&view=update'; $msg = JText::_('LIB_YIREO_CONTROLLER_DB_UPGRADED'); $this->setRedirect($link, $msg); }