Crypt_GPG
[ class tree: Crypt_GPG ] [ index: Crypt_GPG ] [ all elements ]

Class: Crypt_GPG_ProcessControl

Source Location: /Crypt_GPG-1.4.0b4/Crypt/GPG/ProcessControl.php

Class Overview


A class for monitoring and terminating processes by PID


Author(s):

Copyright:

  • 2013 silverorange

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 51]
A class for monitoring and terminating processes by PID

This is used to safely terminate the gpg-agent for GnuPG 2.x. This class is limited in its abilities and can only check if a PID is running and send a PID SIGTERM.



[ Top ]


Class Variables

$pid =

[line 60]

The PID (process identifier) being monitored
  • Access: protected

Type:   integer


[ Top ]



Method Detail

__construct (Constructor)   [line 70]

Crypt_GPG_ProcessControl __construct( integer $pid)

Creates a new process controller from the given PID (process identifier)
  • Access: public

Parameters:

integer   $pid     the PID (process identifier).

[ Top ]

getPid   [line 83]

integer getPid( )

Gets the PID (process identifier) being controlled
  • Return: the PID being controlled.
  • Access: public

[ Top ]

isRunning   [line 99]

boolean isRunning( )

Checks if the process is running

Uses ps on UNIX-like systems and tasklist on Windows.

  • Return: true if the process is running, false if not.
  • Access: public

[ Top ]

terminate   [line 134]

void terminate( )

Ends the process gracefully

The signal SIGTERM is sent to the process. The gpg-agent process will end gracefully upon receiving the SIGTERM signal. Upon 3 consecutive SIGTERM signals the gpg-agent will forcefully shut down.

If the posix extension is available, posix_kill() is used. Otherwise kill is used on UNIX-like systems and taskkill is used in Windows.

  • Access: public

[ Top ]


Documentation generated on Wed, 13 Mar 2013 18:30:11 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.