Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5951493
UnboxedResult.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
UnboxedResult.php
View Options
<?php
namespace
Shellbox\Command
;
class
UnboxedResult
{
/** @var int|null */
private
$exitCode
;
/** @var string|null */
private
$stdout
;
/** @var string|null */
private
$stderr
;
/**
* Set the exit code
*
* @param int $exitCode
* @return $this
*/
public
function
exitCode
(
$exitCode
)
{
$this
->
exitCode
=
$exitCode
;
return
$this
;
}
/**
* Set the stdout contents
*
* @param string $stdout
* @return $this
*/
public
function
stdout
(
$stdout
)
{
$this
->
stdout
=
$stdout
;
return
$this
;
}
/**
* Set the stderr contents
*
* @param string $stderr
* @return $this
*/
public
function
stderr
(
$stderr
)
{
$this
->
stderr
=
$stderr
;
return
$this
;
}
/**
* Combine another result with this one. The semantics are like the shell's
* "&&" operator, although in practice we use this to upgrade an
* UnboxedResult to a BoxedResult, so $this is typically empty.
*
* @param UnboxedResult $other
*/
public
function
merge
(
UnboxedResult
$other
)
{
if
(
!
$this
->
exitCode
)
{
$this
->
exitCode
=
$other
->
exitCode
;
}
$this
->
stdout
.=
$other
->
getStdout
();
$this
->
stderr
.=
$other
->
getStderr
();
}
/**
* Returns exit code of the process
*
* @return int|null
*/
public
function
getExitCode
()
{
return
$this
->
exitCode
;
}
/**
* Returns stdout of the process
*
* @return string|null
*/
public
function
getStdout
()
{
return
$this
->
stdout
;
}
/**
* Returns stderr of the process or null if the Command was configured to add stderr to stdout
* with includeStderr( true )
*
* @return string|null
*/
public
function
getStderr
()
{
return
$this
->
stderr
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 3 2026, 00:49 (5 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a3/d5/58b4e7f0d7898e9f4f001fbef8aa
Default Alt Text
UnboxedResult.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment