function ApiController::createAndApplyStage

Same name and namespace in other branches
  1. main core/modules/package_manager/tests/modules/package_manager_test_api/src/ApiController.php \Drupal\package_manager_test_api\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 the query string, 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 109

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->query
    ->all('runtime'), $request->query
    ->all('dev'));
  $this->stage
    ->apply();
  return $id;
}

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