public function getCommandLineValues()
{
if (empty($this->values) === false) {
return $this->values;
}
$args = $_SERVER['argv'];
array_shift($args);
$this->setCommandLineValues($args);
// Check for content on STDIN.
$handle = fopen('php://stdin', 'r');
if (stream_set_blocking($handle, false) === true) {
$fileContents = '';
while (($line = fgets($handle)) !== false) {
$fileContents .= $line;
usleep(10);
}
stream_set_blocking($handle, true);
fclose($handle);
if (trim($fileContents) !== '') {
$this->values['stdin'] = $fileContents;
}
}
return $this->values;
}