/** * @param AppData $params */ public function prepare($params) { $cartParameters = array(); if ($application = $this->getCartApp()) { $cartParameters = $application->params->find('global.jbzoo_cart_config.', array()); } $this->_session->clearGroup('migration'); $this->_session->set('params', (array) $params, 'migration'); $this->_session->set('oldConfig', (array) $cartParameters, 'migration'); $this->setParams('steps', $this->getStepsInfo()); }
/** * Execute test by name * @param string $testName * @return array */ public function execTest($testName) { $actionName = '_test' . str_replace('_', '', $testName); if ($testName == 'engine_init') { $this->_jbsession->clearGroup($this->_sessionGroup); } if (method_exists($this, $actionName)) { //run tests $values = array(); for ($j = 0; $j < self::TEST_COUNT; $j++) { $st = microtime(true); $result = call_user_func(array($this, $actionName)); $fin = microtime(true); if (is_null($result)) { $values[] = $fin - $st; } else { $values[] = $result; } if (self::TEST_COUNT > 1) { sleep(1); // without very hard test! } } if (strpos($testName, 'version') === 0 || $testName == 'system_loadavg') { // hack reset($values); $value = current($values); } else { $value = array_sum($values) / count($values); } $this->_jbsession->set($testName, $value, $this->_sessionGroup); // set output format return array('value' => $this->toFormat($value, $testName), 'alert' => $this->isAlert($value, $testName)); } return array(); }
/** * Categories import page */ public function categories() { $this->_jbsession->clearGroup('import'); $this->importParams = $this->_config->getGroup('import.categories', $this->_jbuser->getParam('import-categories', $this->_defaultParams)); $this->renderView(); }