function ApiController::createAndApplyStage

Creates a stage, requires packages into it, and applies the changes.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request. The runtime and dev dependencies are expected to be in either the query string or request body, under the 'runtime' and 'dev' keys, respectively.

Return value

string Unique ID for the stage, which can be used to claim the stage before performing other operations on it. Calling code should store this ID for as long as the stage needs to exist.

1 call to ApiController::createAndApplyStage()
ApiController::run in core/modules/package_manager/tests/modules/package_manager_test_api/src/ApiController.php
Begins a stage life cycle.

File

core/modules/package_manager/tests/modules/package_manager_test_api/src/ApiController.php, line 110

Class

ApiController
Provides API endpoints to interact with a stage directory in functional test.

Namespace

Drupal\package_manager_test_api

Code

protected function createAndApplyStage(Request $request) : string {
    $id = $this->stage
        ->create();
    $this->stage
        ->require($request->get('runtime', []), $request->get('dev', []));
    $this->stage
        ->apply();
    return $id;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.