addStep() public method

Adds the given step to this sequence, to be executed after then step specified by $previousStepIdentifier. If no previous step is specified, the new step is added to the list of steps executed right at the start of the sequence.
public addStep ( Step $step, string $previousStepIdentifier = 'start' ) : void
$step Step The new step to add
$previousStepIdentifier string The preceding step
return void
Example #1
0
 /**
  * Builds a boot sequence with the minimum modules necessary for both, compiletime
  * and runtime.
  *
  * @param string $identifier
  * @return Sequence
  * @api
  */
 public function buildEssentialsSequence($identifier)
 {
     $sequence = new Sequence($identifier);
     if ($this->context->isProduction()) {
         $lockManager = new LockManager();
         $lockManager->exitIfSiteLocked();
         if ($identifier === 'compiletime') {
             $lockManager->lockSiteOrExit();
             // make sure the site is unlocked even if the script ends unexpectedly due to an error/exception
             register_shutdown_function([$lockManager, 'unlockSite']);
         }
         $this->setEarlyInstance(LockManager::class, $lockManager);
     }
     $sequence->addStep(new Step('neos.flow:annotationregistry', [Scripts::class, 'registerClassLoaderInAnnotationRegistry']));
     $sequence->addStep(new Step('neos.flow:configuration', [Scripts::class, 'initializeConfiguration']), 'neos.flow:annotationregistry');
     $sequence->addStep(new Step('neos.flow:systemlogger', [Scripts::class, 'initializeSystemLogger']), 'neos.flow:configuration');
     $sequence->addStep(new Step('neos.flow:errorhandling', [Scripts::class, 'initializeErrorHandling']), 'neos.flow:systemlogger');
     $sequence->addStep(new Step('neos.flow:cachemanagement', [Scripts::class, 'initializeCacheManagement']), 'neos.flow:systemlogger');
     return $sequence;
 }