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

Class: System_Command

Source Location: /System_Command-1.0.4/Command.php

Class Overview


The System_Command:: class implements an abstraction for various ways of executing commands (directly using the backtick operator, as a background task after the script has terminated using register_shutdown_function() or as a detached process using nohup).


Author(s):

Version:

  • $Revision: 1.7 $

Methods


Inherited Variables

Inherited Methods


Class Details

[line 61]
The System_Command:: class implements an abstraction for various ways of executing commands (directly using the backtick operator, as a background task after the script has terminated using register_shutdown_function() or as a detached process using nohup).


[ Top ]


Method Detail

System_Command (Constructor)   [line 140]

System_Command System_Command( [ $in_shell = null])

Class constructor

Defines all necessary constants and sets defaults

  • Access: public

Parameters:

   $in_shell   — 

[ Top ]

errorMessage   [line 468]

string errorMessage( integer $in_value)

Return a textual error message for a System_Command error code
  • Return: error message, or false if the error code was not recognized

Parameters:

integer   $in_value   —  error code

[ Top ]

execute   [line 358]

bool execute( )

Executes the code according to given options
  • Return: true if success {or System_Command_Exception}
  • Access: public

[ Top ]

isError   [line 507]

bool isError( int $in_value)

Tell whether a result code from a System_Command method is an error
  • Return: whether $in_value is an error
  • Access: public

Parameters:

int   $in_value   —  result code

[ Top ]

pushCommand   [line 281]

boolean pushCommand( string $in_command, string $in_argument, ... 2)

Used to push a command onto the running command to be executed
  • Return: true on success {or System_Command_Error Exception}
  • Access: public

Parameters:

string   $in_command   —  binary to be run
string   $in_argument   — 
...   2   — 

[ Top ]

pushOperator   [line 326]

boolean pushOperator( string $in_operator)

Used to push an operator onto the running command to be executed
  • Return: true on success {or System_Command_Error Exception}
  • Access: public

Parameters:

string   $in_operator   —  Either string reprentation of operator or system character

[ Top ]

reset   [line 450]

void reset( )

Prepare for a new command to be built
  • Access: public

[ Top ]

setOption   [line 219]

bool setOption( $in_option $in_option, $in_setting $in_setting)

Sets any option

The options are currently: SEQUENCE : Allow a sequence command or not (right now this is always on) SHUTDOWN : Execute commands via a shutdown function SHELL : Path to shell OUTPUT : Output stdout from process NOHUP : Use nohup to detach process BACKGROUND : Run as a background process with &

  • Return: true if succes, else false
  • Access: public

Parameters:

$in_option   $in_option   —  is a constant, which corresponds to the option that should be changed
$in_setting   $in_setting   —  is the value of the option currently being toggled.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:34:32 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.