null, 'tag' => AKEEBA_BACKUP_ORIGIN, 'backupid' => null, ); $defConfig = array_merge($defConfig, $parameters); $profile = $defConfig['profile']; $tag = $defConfig['tag']; $backupid = $defConfig['backupid']; $session = Application::getInstance()->getContainer()->segment; // Try to set the profile from the setup parameters if (!empty($profile)) { $session->set('profile', $profile); } Factory::loadState($tag, $backupid); $kettenrad = Factory::getKettenrad(); $kettenrad->setBackupId($backupid); $registry = Factory::getConfiguration(); $session->set('profile', $registry->activeProfile); $array = $kettenrad->tick(); $ret_array = $kettenrad->getStatusArray(); $array['Progress'] = $ret_array['Progress']; Factory::saveState($tag, $backupid); if ($array['Error'] != '') { throw new \RuntimeException('A backup error had occurred: ' . $array['Error'], 500); } if ($array['HasRun'] == false) { Factory::nuke(); Factory::getFactoryStorage()->reset(); } return $array; } }