@param ProfileContext $context

@return void
175241
protected function doExecute(ProfileContext $context)
    {
        if ($context->getInboundContext()->getMessage()) {
            MessageContextHelper::asStatusResponse($context->getOutboundContext())->setInResponseTo(
                MessageContextHelper::asSamlMessage($context->getInboundContext())->getID()
            );
        }
    }
887652
protected function _actionEdit(AnCommandContext $context)
    {
        $data = $context->data;

        //don't overwrite these two
        unset($data->secret);
        unset($data->dbtype);

        $this->_entity->setData(AnConfig::unbox($data));

        if ($this->_entity->save()) {
            $this->setMessage('COM-SETTINGS-PROMPT-SUCCESS', 'success');
        }
    }
64183
public void addProfile(Profile profile) {
        if (PROFILE_KIND.equals(profile.getKind())) {
            this.profileList.add(profile.getSettings());
        }
    }
175540
public function resolveReferences(ReferenceContext $context = null)
    {
        foreach ($this->_responses as $k => $response) {
            if ($response instanceof Reference) {
                $this->_responses[$k] = $response->resolve($context);
            } else {
                $response->resolveReferences($context);
            }
        }
    }
1175838
protected function doExecute(AssertionContext $context)
    {
        $profileContext = $context->getProfileContext();
        $trustOptions = $profileContext->getTrustOptions();

        if ($trustOptions->getSignAssertions()) {
            $signature = $this->signatureResolver->getSignature($profileContext);
            if ($signature) {
                $this->logger->debug(
                    sprintf(
                        'Signing assertion with fingerprint %s',
                        $signature->getCertificate()->getFingerprint()
                    ),
                    LogHelper::getActionContext($context, $this, array(
                        'certificate' => $signature->getCertificate()->getInfo(),
                    ))
                );
                $context->getAssertion()->setSignature($signature);
            } else {
                $this->logger->critical(
                    'Unable to resolve assertion signature, though signing enabled',
                    LogHelper::getActionErrorContext($context, $this)
                );
            }
        } else {
            $this->logger->debug('Assertion signing disabled', LogHelper::getActionContext($context, $this));
        }
    }
1142953
protected function initializeFiltering(ContextInterface $context)
    {
        $activeFilters = $context->getActiveFilters();

        foreach ($activeFilters as $activeFilter) {
            $filterName = $activeFilter->getFilterName();
            if ($this->table->hasFilter($filterName)) {
                $this->table->getFilter($filterName)->applyFilter($this, $activeFilter);
            }
        }
    }
981115
public function add(string $profile, $inheritContext = false)
    {
        if ($this->has($profile)) {
            throw new Exception("Profile {$profile} already exist.");
        }

        if (!strlen($profile)) {
            throw new Exception("Profile must be set.");
        }

        $child = clone $this;
        $child->clear(!$inheritContext);
        $child->name     = ($this->name ? $this->name . ' > ' : '') . $profile;
        $child->children = [];

        $this->children[$profile] = $child;

        return $child;
    }
1203217
public static function delete_data_for_all_users_in_context(context $context) {
        list($db, $table) = static::get_database_and_table();
        if (!$db || !$table) {
            return;
        }
        $db->delete_records($table, ['contextid' => $context->id]);
    }
340592
public function run(MigrationContext $context)
	{
		$this->setContext($context);
		$this->createMigrationsTable();

		$all_migrations = $this->getAllMigrations();
		$executed_migrations = $this->getExecutedMigrations();

		$migrations_to_execute = array_diff($all_migrations, $executed_migrations);
		$this->executeMigrations($migrations_to_execute);

		$migrations_to_delete = array_diff($executed_migrations, $all_migrations);
		$this->deleteMigrations($migrations_to_delete);
	}
758569
protected function doExecute(ProfileContext $context)
    {
        $response = MessageContextHelper::asResponse($context->getOutboundContext());

        foreach ($this->assertionActions as $index => $action) {
            $name = sprintf('assertion_%s', $index);
            /** @var AssertionContext $assertionContext */
            $assertionContext = $context->getSubContext($name, AssertionContext::class);
            $assertionContext->setId($index);

            $action->execute($assertionContext);

            if ($assertionContext->getEncryptedAssertion()) {
                $response->addEncryptedAssertion($assertionContext->getEncryptedAssertion());
            } elseif ($assertionContext->getAssertion()) {
                $response->addAssertion($assertionContext->getAssertion());
            } else {
                $this->logger->warning('No assertion was built', LogHelper::getActionContext($context, $this));
            }
        }
    }
1345910
public function profileEnd($title = null, array $context = [])
    {
        if (!$this->activeKey) {
            return;
        }

        list($category, $name) = explode('|', $this->activeKey);

        if (isset($this->profiles[$category][$name])) {
            $data = $this->profiles[$category][$name];

            $old = $data['_profile_stats'];
            $data['_profile_stats'] = PhpHelper::runtime($old['startTime'], $old['startMem']);
            $data['_profile_end'] = $context;

            $title = $category . ' - ' . ($title ?: $name);

            $this->activeKey = null;
            $this->log(Logger::DEBUG, $title, $data);
        }
    }
966578
public function resolveReferences(ReferenceContext $context = null)
    {
        foreach ($this->_paths as $key => $path) {
            if ($path === null) {
                continue;
            }
            $path->resolveReferences($context);
        }
    }
383700
public function initialize(ContextInterface $context)
    {
        $context->setDatabase($this->databaseName);
        $context->setAjaxSteps($this->ajaxSteps);
        $context->setAjaxTimeout($this->ajaxTimeout);
        $context->setScreenshotPath($this->screenshotPath);
        $context->setRegionMap($this->regionMap);
        $context->setAdminUrl($this->adminUrl);
        $context->setLoginUrl($this->loginUrl);
    }
639737
protected function _setContext($context)
    {
        $this->context = ($context !== null)
            ? $this->_normalizeContainer($context)
            : null;
    }
179037
protected static function cache_add(context $context) {
        if (isset(self::$cache_contextsbyid[$context->id])) {
            // already cached, no need to do anything - this is relatively cheap, we do all this because count() is slow
            return;
        }

        if (self::$cache_count >= CONTEXT_CACHE_MAX_SIZE) {
            $i = 0;
            foreach(self::$cache_contextsbyid as $ctx) {
                $i++;
                if ($i <= 100) {
                    // we want to keep the first contexts to be loaded on this page, hopefully they will be needed again later
                    continue;
                }
                if ($i > (CONTEXT_CACHE_MAX_SIZE / 3)) {
                    // we remove oldest third of the contexts to make room for more contexts
                    break;
                }
                unset(self::$cache_contextsbyid[$ctx->id]);
                unset(self::$cache_contexts[$ctx->contextlevel][$ctx->instanceid]);
                self::$cache_count--;
            }
        }

        self::$cache_contexts[$context->contextlevel][$context->instanceid] = $context;
        self::$cache_contextsbyid[$context->id] = $context;
        self::$cache_count++;
    }
519608
public function setProfile($profile)
	{
		$this->_profile = $profile;

		// Set the parser configs.
		$this->setConfig($this->getProfileConfig('parser'));
        $this->reset($this->_string, true);
        $this->defaults();

        return $this;
	}
17730
public function init(ServerContextInterface $serverContext)
    {

        // initialize the server context
        $this->serverContext = $serverContext;

        // initialize the profile logger
        if ($serverContext->hasLogger(LoggerUtils::PROFILE)) {
            $this->profileLogger = $serverContext->getLogger(LoggerUtils::PROFILE);
        }
    }