private function doExtensionUpgrade() { ob_start(); // Load up as much of Joomla as we need require 'bfExtensions.php'; $app = JFactory::getApplication('Myjoomla'); // init reply to myJoomla.com $result = array(); $result['messages'] = array(); // which row in the _updates table should we use $this->_db->setQuery('SELECT update_id from #__updates WHERE extension_id = "' . $this->_dataObj->eid . '"'); $extension_row_id = $this->_db->loadResult(); // Do the update $ext = new bfExtensions(); $result['result'] = $ext->doUpdate($extension_row_id); // Grab any error messages $result['messages'] = $app->getMessageQueue(); // translate messages $lang = JFactory::getLanguage(); $lang->load('com_installer', JPATH_ADMINISTRATOR, 'en-GB', TRUE); $lang->load('lib_joomla', JPATH_ADMINISTRATOR, 'en-GB', TRUE); if (count($result['messages'])) { foreach ($result['messages'] as &$msg) { $msg['message'] = JText::_($msg['message']); } } bfEncrypt::reply('success', array('result' => $result)); }