Class processManager

Description

background script process manager.

Initializes the script, creates the PID file, and deletes it

Located in /automne/classes/scripts/backgroundScript/processmanager.php (line 29)


	
			
Class Constant Summary
 MASTER_SCRIPT_NAME = 'Script Master'
Variable Summary
 string $_scriptName
 timestamp $_startDate
 string $_tmpPath
Method Summary
 void processManager (string $scriptName)
 boolean deletePIDFile ()
 string getAppCode ()
 integer getExecutionTime ()
 string getPIDFileName ()
 string getPIDFilePath ()
 array getRunningScript ()
 string getTempPath ()
 boolean hasRunningScript ()
 boolean setParameters ( $module,  $parameters)
 boolean writePIDFile ()
Variables
string $_scriptName (line 38)

Contains the script name

  • access: private
timestamp $_startDate (line 52)

The launch date : can be used to know what is the time after launch

  • access: private
string $_tmpPath (line 45)

The tmp path : where to store 'PID' files ?

  • access: private
Methods
Constructor processManager (line 62)

Constructor.

Check to see if the script in argument has already a process running.

  • access: public
void processManager (string $scriptName)
  • string $scriptName: The name of the script to manage
deletePIDFile (line 151)

Deletes the PID file.

  • return: true if deletion went well, false otherwise
  • access: public
boolean deletePIDFile ()
getAppCode (line 348)

get sanitized application codename

  • return: the sanitized codename
  • access: public
string getAppCode ()
getExecutionTime (line 236)

Returns the number of seconds since the start of the script

  • access: public
integer getExecutionTime ()
getPIDFileName (line 206)

Returns the PID file name.

  • access: public
string getPIDFileName ()
getPIDFilePath (line 192)

Returns the PID file path.

  • access: public
string getPIDFilePath ()
getRunningScript (line 247)

select all running scripts from scriptsStatuses Table and check PID files.

  • access: public
array getRunningScript ()
getTempPath (line 220)

Returns the temp path for PID files.

  • access: public
string getTempPath ()
hasRunningScript (line 327)

check if scripts are currently running

  • access: public
boolean hasRunningScript ()
setParameters (line 84)

Set the script informations.

  • return: true on success, false on failure
  • access: public
boolean setParameters ( $module,  $parameters)
  • $module
  • $parameters
writePIDFile (line 106)

Write the PID file. If it already exists, do nothing and return false

  • return: true if creation went well, false otherwise
  • access: public
boolean writePIDFile ()
Class Constants
MASTER_SCRIPT_NAME = 'Script Master' (line 31)

Documentation generated on Wed, 15 Feb 2012 15:37:39 +0100 by phpDocumentor 1.4.3