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

Class: System_Command

Source Location: /System_Command-1.0.8/System/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$

Methods


Inherited Variables

Inherited Methods


Class Details

[line 62]
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 141]

System_Command System_Command( [ $in_shell = null])

Class constructor

Defines all necessary constants and sets defaults

  • Access: public

Parameters:

   $in_shell   — 

[ Top ]

errorMessage   [line 507]

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 377]

bool execute( )

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

[ Top ]

isError   [line 547]

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 300]

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 345]

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 489]

void reset( )

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

[ Top ]

setOption   [line 237]

bool setOption( string $in_option, mixed $in_setting)

Sets the value for an option. Each option should be set to true or false; except the 'SHELL' option which should be a string naming a shell. The options are:

'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 &;

'STDERR' Output on stderr will raise an error, even if the command's exit value is zero. The output from stderr can be retrieved using the getDebugInfo() method of the Pear_ERROR object returned by execute().;

'AUTORESET' Automatically call reset() after a successful call of execute();

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

Parameters:

string   $in_option   —  is a case-sensitive string, corresponding to the option that should be changed
mixed   $in_setting   —  is the new value for the option

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:47:25 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.