You are here

private function ProcessFactory::isComposerCommand in Automatic Updates 8.2

Determines if a command is running Composer.

Parameters

string[] $command: The command parts.

Return value

bool TRUE if the command is running Composer, FALSE otherwise.

1 call to ProcessFactory::isComposerCommand()
ProcessFactory::create in package_manager/src/ProcessFactory.php

File

package_manager/src/ProcessFactory.php, line 108

Class

ProcessFactory
Defines a process factory which sets the COMPOSER_HOME environment variable.

Namespace

Drupal\package_manager

Code

private function isComposerCommand(array $command) : bool {
  $executable = $command[0];
  $executable_parts = explode('/', $executable);
  $file = array_pop($executable_parts);
  return strpos($file, 'composer') === 0;
}