Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ProcessExecutor.php

function ProcessExecutor::startJob

2 calls to ProcessExecutor::startJob()
ProcessExecutor::countActiveJobs in vendor/composer/composer/src/Composer/Util/ProcessExecutor.php
@internal
ProcessExecutor::executeAsync in vendor/composer/composer/src/Composer/Util/ProcessExecutor.php
starts a process on the commandline in async mode

File

vendor/composer/composer/src/Composer/Util/ProcessExecutor.php, line 307

Class

ProcessExecutor
@author Robert Schönthal <seroscho@googlemail.com> @author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Util

Code

private function startJob(int $id) : void {
    $job =& $this->jobs[$id];
    if ($job['status'] !== self::STATUS_QUEUED) {
        return;
    }
    // start job
    $job['status'] = self::STATUS_STARTED;
    $this->runningJobs++;
    $command = $job['command'];
    $cwd = $job['cwd'];
    $this->outputCommandRun($command, $cwd, true);
    try {
        if (is_string($command)) {
            $process = Process::fromShellCommandline($command, $cwd, null, null, static::getTimeout());
        }
        else {
            $process = new Process($command, $cwd, null, null, static::getTimeout());
        }
    } catch (\Throwable $e) {
        $job['reject']($e);
        return;
    }
    $job['process'] = $process;
    try {
        $process->start();
    } catch (\Throwable $e) {
        $job['reject']($e);
        return;
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal