X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FCommand%2FEditCommand.php;fp=vendor%2Fpsy%2Fpsysh%2Fsrc%2FCommand%2FEditCommand.php;h=0571414948f29da7cce3e6663346dfa7bdb79251;hp=7d95569280f16e8b4ff1b85e13fa4325271db68a;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/vendor/psy/psysh/src/Command/EditCommand.php b/vendor/psy/psysh/src/Command/EditCommand.php index 7d9556928..057141494 100644 --- a/vendor/psy/psysh/src/Command/EditCommand.php +++ b/vendor/psy/psysh/src/Command/EditCommand.php @@ -95,7 +95,7 @@ class EditCommand extends Command implements ContextAware $shouldRemoveFile = false; if ($filePath === null) { - $filePath = tempnam($this->runtimeDir, 'psysh-edit-command'); + $filePath = \tempnam($this->runtimeDir, 'psysh-edit-command'); $shouldRemoveFile = true; } @@ -138,9 +138,9 @@ class EditCommand extends Command implements ContextAware { // If the file argument was a variable, get it from the context if ($fileArgument !== null && - strlen($fileArgument) > 0 && + \strlen($fileArgument) > 0 && $fileArgument[0] === '$') { - $fileArgument = $this->context->get(preg_replace('/^\$/', '', $fileArgument)); + $fileArgument = $this->context->get(\preg_replace('/^\$/', '', $fileArgument)); } return $fileArgument; @@ -156,16 +156,16 @@ class EditCommand extends Command implements ContextAware */ private function editFile($filePath, $shouldRemoveFile) { - $escapedFilePath = escapeshellarg($filePath); + $escapedFilePath = \escapeshellarg($filePath); $pipes = []; - $proc = proc_open((getenv('EDITOR') ?: 'nano') . " {$escapedFilePath}", [STDIN, STDOUT, STDERR], $pipes); - proc_close($proc); + $proc = \proc_open((\getenv('EDITOR') ?: 'nano') . " {$escapedFilePath}", [STDIN, STDOUT, STDERR], $pipes); + \proc_close($proc); - $editedContent = @file_get_contents($filePath); + $editedContent = @\file_get_contents($filePath); if ($shouldRemoveFile) { - @unlink($filePath); + @\unlink($filePath); } if ($editedContent === false) {