Permalink
Browse files

Request #14860 New option: AUTORESET

  • Loading branch information...
1 parent ef5f978 commit 41f6bc8e56f48c8b73a2b7227aabff8acf8da3e2 @CloCkWeRX CloCkWeRX committed Dec 9, 2011
Showing with 12 additions and 1 deletion.
  1. +12 −1 Command.php
View
13 Command.php
@@ -148,7 +148,8 @@ function System_Command($in_shell = null)
'OUTPUT' => true,
'NOHUP' => false,
'BACKGROUND' => false,
- 'STDERR' => false
+ 'STDERR' => false,
+ 'AUTORESET' => false
);
// prepare the available control operators
@@ -223,6 +224,9 @@ function System_Command($in_shell = null)
* method of the Pear_ERROR object returned by
* execute().;
*
+ * 'AUTORESET' Automatically call reset() after a successful
+ * call of execute();
+ *
* @param string $in_option is a case-sensitive string,
* corresponding to the option
* that should be changed
@@ -408,6 +412,9 @@ function execute()
$line = "system(\"{$this->systemCommand}$suffix\");";
$function = create_function('', $line);
register_shutdown_function($function);
+ if ($this->options['AUTORESET']) {
+ $this->reset();
+ }
return true;
}
else {
@@ -438,6 +445,10 @@ function execute()
}
}
+ if ((!PEAR::isError($return)) && ($this->options['AUTORESET'])) {
+ $this->reset();
+ }
+
unlink($tmpFile);
return $return;
}

0 comments on commit 41f6bc8

Please sign in to comment.