You are here

public function DevelCommands::event in Devel 8.3

Same name and namespace in other branches
  1. 8 src/Commands/DevelCommands.php \Drupal\devel\Commands\DevelCommands::event()
  2. 8.2 src/Commands/DevelCommands.php \Drupal\devel\Commands\DevelCommands::event()
  3. 4.x src/Commands/DevelCommands.php \Drupal\devel\Commands\DevelCommands::event()

List implementations of a given event and optionally edit one.

@command devel:event

@usage devel-event Pick a Kernel event, then pick an implementation, and then view its source code. @usage devel-event kernel.terminate Pick a terminate subscribers implementation and view its source code. @aliases fne,fn-event,event

Parameters

string $event: The name of the event to explore. If omitted, a list of events is shown.

string $implementation: The name of the implementation to show. Usually omitted.

File

src/Commands/DevelCommands.php, line 164

Class

DevelCommands
Class DevelCommands.

Namespace

Drupal\devel\Commands

Code

public function event($event, $implementation) {
  $info = $this
    ->codeLocate($implementation);
  $exec = self::getEditor();
  $cmd = sprintf($exec, Escape::shellArg($info['file']));
  $process = $this
    ->processManager()
    ->shell($cmd);
  $process
    ->setTty(TRUE);
  $process
    ->mustRun();
}