protected function copyTable_k2_items($table) { $this->source = $this->destination = "#__{$table}"; // Clone table $this->cloneTable($this->source, $this->destination); // Get data $rows = parent::getSourceData('*'); // Do some custom post processing on the list. foreach ($rows as &$row) { $row['access'] = $row['access'] == 0 ? 1 : $row['access'] + 1; $row['params'] = $this->convertParams($row['params']); $row['plugins'] = $this->convertParams($row['plugins']); } $this->setDestinationData($rows); return true; }
/** * Copy kunena_categories table from old site to new site. * * You can create custom copy functions for all your tables. * * If you want to copy your table in many smaller chunks, * please store your custom state variables into $this->state and return false. * Returning false will force jUpgrade to call this function again, * which allows you to continue import by reading $this->state before continuing. * * @param string $table * @return boolean Ready (true/false) * @since 1.6.4 * @throws Exception */ protected function copyTable_kunena_categories($table) { $this->source = $this->destination = "#__{$table}"; // Clone table $this->cloneTable($this->source, $this->destination); // Get data $rows = parent::getSourceData('*'); // Do some custom post processing on the list. foreach ($rows as &$row) { $row['params'] = $this->convertParams($row['params']); if (!isset($row['accesstype']) || $row['accesstype'] == 'joomla.group') { if ($row['admin_access'] != 0) { $row['admin_access'] = $this->mapUserGroup($row['admin_access']); } if ($row['pub_access'] == -1) { // All registered $row['pub_access'] = 2; $row['pub_recurse'] = 1; } elseif ($row['pub_access'] == 0) { // Everybody $row['pub_access'] = 1; $row['pub_recurse'] = 1; } elseif ($row['pub_access'] == 1) { // Nobody $row['pub_access'] = 8; } else { // User groups $row['pub_access'] = $this->mapUserGroup($row['pub_access']); } } elseif ($row['accesstype'] == 'joomla.level') { // Convert Joomla access levels $row['access']++; } } $this->setDestinationData($rows); return true; }
/** * processStep * * @return none * @since 2.5.0 */ public function _processExtensionStep($step) { // Require the file require_once JPATH_COMPONENT . '/includes/jupgrade.extensions.class.php'; // Get jUpgradeExtensions instance $extension = jUpgradeExtensions::getInstance($step); $success = $extension->upgradeExtension(); if ($extension->isReady()) { $this->_updateStep($step); } }
/* $rows = parent::getSourceData( '`bid` AS id,`cid`,`type`,`name`,`alias`, `imptotal` ,`impmade`, `clicks`, ' .'`clickurl`, `checked_out`, `checked_out_time`, `showBanner` AS state,' .' `custombannercode`, `description`, `sticky`, `ordering`, `publish_up`, ' .' `publish_down`, `params`', null, 'bid' ); // Do some custom post processing on the list. foreach ($rows as &$row) { $row['params'] = $this->convertParams($row['params']); // Remove unused fields. unset($row['gid']); } */ //return $rows; } } // Search for 3rd party extensions $extensions = new jUpgradeExtensions(); //TODO: Make search method $search = $extensions->search(); /* if ($search) { echo "DO SOMETHING"; } */