protected function getActionFiles($action)
{
$prefix = preg_quote(str_repeat($action, 3));
$p1 = $action == '-' ? 'a' : 'b';
preg_match_all('/^' . $prefix . ' (.+)$/m', $this->read(), $matches);
$paths = array();
foreach ($matches[1] as $match) {
if ($match === '/dev/null') {
continue;
}
$slashPos = strpos($match, '/');
if (substr($match, 0, $slashPos) !== $p1) {
throw new Exception('Unexpected path: ' . $match);
}
$paths[] = substr($match, $slashPos + 1);
}
return $paths;
}