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

Breadcrumb

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

function Process::close

Closes process resource, closes file handles, sets the exitcode.

Return value

int The exitcode

2 calls to Process::close()
Process::stop in vendor/symfony/process/Process.php
Stops the process.
Process::updateStatus in vendor/symfony/process/Process.php
Updates the status of the process, reads pipes.

File

vendor/symfony/process/Process.php, line 1435

Class

Process
Process is a thin wrapper around proc_* functions to easily start independent PHP processes.

Namespace

Symfony\Component\Process

Code

private function close() : int {
    $this->processPipes
        ->close();
    if ($this->process) {
        proc_close($this->process);
        $this->process = null;
    }
    $this->exitcode = $this->processInformation['exitcode'];
    $this->status = self::STATUS_TERMINATED;
    if (-1 === $this->exitcode) {
        if ($this->processInformation['signaled'] && 0 < $this->processInformation['termsig']) {
            // if process has been signaled, no exitcode but a valid termsig, apply Unix convention
            $this->exitcode = 128 + $this->processInformation['termsig'];
        }
        elseif ($this->isSigchildEnabled()) {
            $this->processInformation['signaled'] = true;
            $this->processInformation['termsig'] = -1;
        }
    }
    // Free memory from self-reference callback created by buildCallback
    // Doing so in other contexts like __destruct or by garbage collector is ineffective
    // Now pipes are closed, so the callback is no longer necessary
    $this->callback = null;
    return $this->exitcode;
}
RSS feed
Powered by Drupal