mirror of
https://hk.gh-proxy.com/https://github.com/wp-cli/profile-command.git
synced 2025-08-21 06:39:02 +08:00
33 lines
560 B
PHP
33 lines
560 B
PHP
<?php
|
|
|
|
namespace WP_CLI;
|
|
|
|
/**
|
|
* Results of an executed command.
|
|
*/
|
|
class ProcessRun {
|
|
|
|
/**
|
|
* @var array $props Properties of executed command.
|
|
*/
|
|
public function __construct( $props ) {
|
|
foreach ( $props as $key => $value ) {
|
|
$this->$key = $value;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Return properties of executed command as a string.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function __toString() {
|
|
$out = "$ $this->command\n";
|
|
$out .= "$this->stdout\n$this->stderr";
|
|
$out .= "cwd: $this->cwd\n";
|
|
$out .= "exit status: $this->return_code";
|
|
|
|
return $out;
|
|
}
|
|
|
|
}
|