phing-tasks-system

# Class: ExecTask Source Location: /tasks/system/ExecTask.php
### Class Overview
    ProjectComponent
       |
       --Task
          |
          --ExecTask
Executes a command on the shell. #### Author(s): Hans Lellelid <hans@xmpl.org> Andreas Aderhold <andi@binarycloud.com> #### Version: $Revision: 552 $ #### Copyright: � 2001,2002 THYRELL. All rights reserved | ### Variables $checkreturn $command $dir $error $escape $logOutput $os $output $outputProperty $passthru $returnProperty $spawn | ### Methods execute main setCheckreturn setCommand setDir setError setEscape setLogoutput setOs setOutput setOutputProperty setPassthru setReturnProperty setSpawn
### Inherited Variables #### Class: Task Task::$description Task::$location Task::$target Task::$taskName Task::$taskType Task::$wrapper #### Class: ProjectComponent ProjectComponent::$project | ### Inherited Methods #### Class: Task Task::getDescription() Returns the textual description of the task Task::getLocation() Returns the location within the buildfile this task occurs. Used by BuildException to give detailed error messages. Task::getOwningTarget() Returns the owning target of this task. Task::getRegisterSlot() Returns a name Task::getRuntimeConfigurableWrapper() Returns the wrapper object for runtime configuration Task::getTaskName() Returns the name of task, used only for log messages Task::getTaskType() Returns the name of the task under which it was invoked, usually the XML tagname Task::init() Called by the parser to let the task initialize properly. Task::log() Provides a project level log event to the task. Task::main() Called by the project to let the task do it's work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running <em>phing target1 target2</em> will run all tasks in target3 twice. Task::maybeConfigure() Configure this task if it hasn't been done already. Task::perform() Perfrom this task Task::setDescription() Sets a textual description of the task Task::setLocation() Sets the location within the buildfile this task occurs. Called by the parser to set location information. Task::setOwningTarget() Sets the owning target this task belongs to. Task::setRuntimeConfigurableWrapper() Sets the wrapper object this task should use for runtime configurable elements. Task::setTaskName() Sets the name of this task for log messages Task::setTaskType() Sets the type of the task. Usually this is the name of the XML tag #### Class: ProjectComponent ProjectComponent::getProject() Returns a reference to current project ProjectComponent::log() Logs a message with the given priority. ProjectComponent::setProject() References the project to the current component.
### Class Details [line 33] Executes a command on the shell. #### Tags:
author: | Hans Lellelid <hans@xmpl.org>
author: | Andreas Aderhold <andi@binarycloud.com>
version: | $Revision: 552 $
copyright: | � 2001,2002 THYRELL. All rights reserved
[ Top ] ### Class Variables #### $checkreturn = false [line 107] Whether to check the return code. #### Tags:
access: | protected
Type: | boolean
[ Top ] #### $command = [line 39] Command to execute. #### Tags:
access: | protected
Type: | string
[ Top ] #### $dir = [line 45] Working directory. #### Tags:
access: | protected
Type: | File
[ Top ] #### $error = [line 81] Where to direct error output. #### Tags:
access: | protected
Type: | File
[ Top ] #### $escape = false [line 57] Whether to escape shell command using escapeshellcmd(). #### Tags:
access: | protected
Type: | boolean
[ Top ] #### $logOutput = false [line 75] Whether to log returned output as MSG_INFO instead of MSG_VERBOSE #### Tags:
access: | protected
Type: | boolean
[ Top ] #### $os = [line 51] Operating system. #### Tags:
access: | protected
Type: | string
[ Top ] #### $output = [line 63] Where to direct output. #### Tags:
access: | protected
Type: | File
[ Top ] #### $outputProperty = [line 101] Property name to set with output value from exec call. #### Tags:
access: | protected
Type: | string
[ Top ] #### $passthru = false [line 69] Whether to use PHP's passthru() function instead of exec() #### Tags:
access: | protected
Type: | boolean
[ Top ] #### $returnProperty = [line 94] Property name to set with return value from exec call. #### Tags:
access: | protected
Type: | string
[ Top ] #### $spawn = false [line 87] If spawn is set then [unix] programs will redirect stdout and add '&'. #### Tags:
access: | protected
Type: | boolean
[ Top ] ### Class Methods ### method execute [line 122]
`int execute( )`
Executes a program and returns the return code. Output from command is logged at INFO level. #### Tags:
return: | Return code from execution.
access: | public
[ Top ] ### method main [line 113]
`void main( )`
Main method: wraps execute() command. #### Tags:
access: | public
Overrides Task::main() (Called by the project to let the task do it's work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running <em>phing target1 target2</em> will run all tasks in target3 twice.) [ Top ] ### method setCheckreturn [line 287]
`void setCheckreturn( boolean $checkreturn)`
Whether to check the return code. #### Parameters:
boolean | $checkreturn |
[ Top ] ### method setCommand [line 215]
`void setCommand( mixed $command)`
The command to use. #### Parameters:
mixed | $command | String or string-compatible (e.g. w/ __toString()).
[ Top ] ### method setDir [line 231]
`void setDir( $dir)`
Specify the working directory for executing this command. #### Parameters:
PhingFile | $dir |
[ Top ] ### method setError [line 255]
`void setError( $f, PhingFile $output)`
File to which error output should be written. #### Parameters:
PhingFile | $output |
PhingFile | $f |
[ Top ] ### method setEscape [line 223]
`void setEscape( boolean $escape)`
Whether to use escapeshellcmd() to escape command. #### Parameters:
boolean | $escape |
[ Top ] ### method setLogoutput [line 271]
`void setLogoutput( $logOutput, boolean $passthru)`
Whether to log returned output as MSG_INFO instead of MSG_VERBOSE #### Parameters:
boolean | $passthru |
| $logOutput |
[ Top ] ### method setOs [line 239]
`void setOs( string $os)`
Specify OS (or muliple OS) that must match in order to execute this command. #### Parameters:
string | $os |
[ Top ] ### method setOutput [line 247]
`void setOutput( $f, PhingFile $output)`
File to which output should be written. #### Parameters:
PhingFile | $output |
PhingFile | $f |
[ Top ] ### method setOutputProperty [line 303]
`void setOutputProperty( string $prop)`
The name of property to set to output value from exec() call. #### Parameters:
string | $prop |
[ Top ] ### method setPassthru [line 263]
`void setPassthru( boolean $passthru)`
Whether to use PHP's passthru() function instead of exec() #### Parameters:
boolean | $passthru |
[ Top ] ### method setReturnProperty [line 295]
`void setReturnProperty( string $prop)`
The name of property to set to return value from exec() call. #### Parameters:
string | $prop |
[ Top ] ### method setSpawn [line 279]
`void setSpawn( boolean $spawn)`
Whether to suppress all output and run in the background. #### Parameters:
boolean | $spawn |
[ Top ] Documentation generated on Mon, 19 Oct 2009 10:50:50 +0200 by phpDocumentor 1.4.3