diff vendor/psy/psysh/src/Command/EditCommand.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children
line wrap: on
line diff
--- a/vendor/psy/psysh/src/Command/EditCommand.php	Thu Feb 28 11:14:44 2019 +0000
+++ b/vendor/psy/psysh/src/Command/EditCommand.php	Thu Feb 28 13:11:55 2019 +0000
@@ -95,7 +95,7 @@
         $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 @@
     {
         // 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 @@
      */
     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) {