'Save the actual state to the core.
:param relaxedTarget: if True, return OK even if the target wasn\'t
successfully saved
:return: True if all went ok'

def save_state_to_core(self, relaxedTarget=False):

    for plugin_type in self.w3af.plugins.get_plugin_types():
        self.w3af.plugins.set_plugins([], plugin_type)
    for (plugin_type, plugins) in self.pcbody.get_activated_plugins():
        self.w3af.plugins.set_plugins(plugins, plugin_type)
    options = self.w3af.target.get_options()
    url = self.pcbody.target.get_text().decode('utf8')
    target_option = options['target']
    if relaxedTarget:
        try:
            target_option.set_value(url)
            self.w3af.target.set_options(options)
        except:
            pass
        return True
    else:
        try:
            helpers.coreWrap(target_option.set_value, url)
            helpers.coreWrap(self.w3af.target.set_options, options)
        except BaseFrameworkException:
            return False
    return True
