/** * @return AppData */ public function setParams($key, $value) { $params = $this->getParams(); $params->set($key, $value); $params = $this->app->jbarray->mapRecursive(function ($value) { if (is_array($value) || $value instanceof AppData) { $value = (array) $value; } return $value; }, $params); $this->_session->set('params', (array) $params, 'migration'); }
/** * @return array */ public function getTestData() { static $result; if (!isset($result)) { $values = $this->_jbsession->getGroup($this->_sessionGroup); $values = $this->app->data->create($values); $result = array('engine' => array(array('key' => 'engine_init', 'type' => 'less', 'value' => $values->get('engine_init', '-'), 'standart' => 0.25, 'postfix' => 'in_sec'), array('key' => 'memory_peak', 'type' => 'less', 'value' => $values->get('memory_peak', '-'), 'standart' => 15728640, 'postfix' => '')), 'cpu' => array(array('key' => 'cpu_complex', 'type' => 'more', 'value' => $values->get('cpu_complex', '-'), 'standart' => 9.0, 'postfix' => 'mil_in_sec'), array('key' => 'cpu_sin', 'type' => 'less', 'value' => $values->get('cpu_sin', '-'), 'standart' => 0.3, 'postfix' => 'in_sec'), array('key' => 'cpu_concat_dot', 'type' => 'less', 'value' => $values->get('cpu_concat_dot', '-'), 'standart' => 0.2, 'postfix' => 'in_sec'), array('key' => 'cpu_concat_quotes', 'type' => 'less', 'value' => $values->get('cpu_concat_quotes', '-'), 'standart' => 0.25, 'postfix' => 'in_sec'), array('key' => 'cpu_concat_array', 'type' => 'less', 'value' => $values->get('cpu_concat_array', '-'), 'standart' => 0.6, 'postfix' => 'in_sec')), 'mysql' => array(array('key' => 'mysql_connect', 'type' => 'less', 'value' => $values->get('mysql_connect', '-'), 'standart' => 0.005, 'postfix' => 'in_sec'), array('key' => 'mysql_sin', 'type' => 'less', 'value' => $values->get('mysql_sin', '-'), 'standart' => 0.1, 'postfix' => 'in_sec'), array('key' => 'mysql_insert', 'type' => 'less', 'value' => $values->get('mysql_insert', '-'), 'standart' => 3.0, 'postfix' => 'in_sec'), array('key' => 'mysql_select', 'type' => 'less', 'value' => $values->get('mysql_select', '-'), 'standart' => 0.03, 'postfix' => 'in_sec'), array('key' => 'mysql_insert_joomla', 'type' => 'less', 'value' => $values->get('mysql_insert_joomla', '-'), 'standart' => 0.25, 'postfix' => 'in_sec'), array('key' => 'mysql_select_joomla', 'type' => 'less', 'value' => $values->get('mysql_select_joomla', '-'), 'standart' => 0.03, 'postfix' => 'in_sec'), array('key' => 'mysql_select_advance', 'type' => 'more', 'value' => $values->get('mysql_select_advance', '-'), 'standart' => 7800, 'postfix' => ''), array('key' => 'mysql_insert_advance', 'type' => 'more', 'value' => $values->get('mysql_insert_advance', '-'), 'standart' => 5600, 'postfix' => ''), array('key' => 'mysql_replace_advance', 'type' => 'more', 'value' => $values->get('mysql_replace_advance', '-'), 'standart' => 5800, 'postfix' => ''), array('key' => 'db_uptime', 'type' => 'more', 'value' => $values->get('db_uptime', '-'), 'standart' => 1, 'postfix' => 'days'), array('key' => 'db_send', 'type' => 'less', 'value' => $values->get('db_send', '-'), 'standart' => 100000000, 'postfix' => ''), array('key' => 'db_connections', 'type' => 'less', 'value' => $values->get('db_connections', '-'), 'standart' => 300, 'postfix' => ''), array('key' => 'db_select_count', 'type' => 'less', 'value' => $values->get('db_select_count', '-'), 'standart' => 10000, 'postfix' => '')), 'fs' => array(array('key' => 'fs_simple', 'type' => 'more', 'value' => $values->get('fs_simple', '-'), 'standart' => 20000, 'postfix' => ''), array('key' => 'fs_complex', 'type' => 'more', 'value' => $values->get('fs_complex', '-'), 'standart' => 8000, 'postfix' => ''), array('key' => 'fs_complex_joomla', 'type' => 'more', 'value' => $values->get('fs_complex_joomla', '-'), 'standart' => 6000, 'postfix' => ''), array('key' => 'fs_write', 'type' => 'less', 'value' => $values->get('fs_write', '-'), 'standart' => 3.5, 'postfix' => 'in_sec'), array('key' => 'fs_read', 'type' => 'less', 'value' => $values->get('fs_read', '-'), 'standart' => 0.35, 'postfix' => 'in_sec')), 'mail' => array(array('key' => 'mail_joomla', 'type' => 'less', 'value' => $values->get('mail_joomla', '-'), 'standart' => 0.12, 'postfix' => 'in_sec'), array('key' => 'mail_php', 'type' => 'less', 'value' => $values->get('mail_php', '-'), 'standart' => 0.1, 'postfix' => 'in_sec')), 'others' => array(array('key' => 'session_init', 'type' => 'less', 'value' => $values->get('session_init', '-'), 'standart' => 0.005, 'postfix' => 'in_sec'), array('key' => 'realpath_used', 'type' => 'less', 'value' => $values->get('realpath_used', '-'), 'standart' => 786432, 'postfix' => ''), array('key' => 'realpath_remaining', 'type' => 'more', 'value' => $values->get('realpath_remaining', '-'), 'standart' => 262144, 'postfix' => ''), array('key' => 'system_loadavg', 'type' => 'less', 'value' => $values->get('system_loadavg', '-'), 'standart' => 5.0, 'postfix' => '')), 'version' => array(array('key' => 'version_os', 'type' => 'none', 'value' => $values->get('version_os', '-'), 'standart' => 'Linux-like system', 'postfix' => ''), array('key' => 'version_php', 'type' => 'none', 'value' => $values->get('version_php', '-'), 'standart' => '5.3.x+', 'postfix' => ''), array('key' => 'version_mysql', 'type' => 'none', 'value' => $values->get('version_mysql', '-'), 'standart' => '5.x+', 'postfix' => ''), array('key' => 'version_joomla', 'type' => 'none', 'value' => $values->get('version_joomla', '-'), 'standart' => '3.1.x+', 'postfix' => ''), array('key' => 'version_zoo', 'type' => 'none', 'value' => $values->get('version_zoo', '-'), 'standart' => '3.1.x+', 'postfix' => ''), array('key' => 'version_jbzoo', 'type' => 'none', 'value' => $values->get('version_jbzoo', '-'), 'standart' => '2.1.x+', 'postfix' => '')), 'result' => array(array('key' => 'total_engine', 'type' => 'more', 'value' => $values->get('total_engine', '-'), 'standart' => 0, 'postfix' => ''), array('key' => 'total_cpu', 'type' => 'more', 'value' => $values->get('total_cpu', '-'), 'standart' => 0, 'postfix' => ''), array('key' => 'total_mysql', 'type' => 'more', 'value' => $values->get('total_mysql', '-'), 'standart' => 0, 'postfix' => ''), array('key' => 'total_mail', 'type' => 'more', 'value' => $values->get('total_mail', '-'), 'standart' => 0, 'postfix' => ''), array('key' => 'total_fs', 'type' => 'more', 'value' => $values->get('total_fs', '-'), 'standart' => 0, 'postfix' => ''), array('key' => 'total_score', 'type' => 'more', 'value' => $values->get('total_score', '-'), 'standart' => 0, 'postfix' => ''), array('key' => 'total_fail', 'type' => 'less', 'value' => $values->get('total_fail', '-'), 'standart' => 0, 'postfix' => ''))); } return $result; }
/** * @return bool */ protected function _postImport() { $addedIds = (array) $this->_jbsession->get('ids', 'import-ids'); $addedIds = array_filter($addedIds); $mode = $this->_jbsession->get('lose', 'import'); if ($mode == 0) { $this->_('No post precessing', 'Info'); } else { $this->_('Total items imported: ' . count($addedIds), 'Info'); } $this->_jbsession->set('ids', $addedIds, 'import-ids'); @$this->_jbimport->itemsPostProcess(); return true; }
/** * Categories steps action */ public function categoriesSteps() { $lose = $this->_jbrequest->get('lose'); $key = $this->_jbrequest->get('key'); $assign = $this->_jbrequest->getArray('assign'); $create = $this->_jbrequest->get('create'); $createAlias = $this->_jbrequest->get('createAlias', 0); $appid = (int) $this->_jbrequest->get('appid'); if (empty($appid) || empty($assign)) { $this->app->jbnotify->notice(JText::_('JBZOO_INCORRECT_DATA')); $this->setRedirect($this->app->jbrouter->admin(array('task' => 'index'))); } $data = array('appid' => $appid, 'lose' => $lose, 'key' => $key, 'create' => $create, 'createAlias' => $createAlias, 'assign' => $assign); $this->_jbsession->setBatch($data, 'import'); // save to user params $this->_config->setGroup('import.last.categories', $data); $this->renderView(); }