Hoa central
Editor.php
Go to the documentation of this file.
1 <?php
2 
38 
39 use Hoa\Console;
40 
49 class Editor
50 {
59  public static function open($file = '', $editor = null)
60  {
61  if (null === $editor) {
62  if (isset($_SERVER['EDITOR'])) {
63  $editor = $_SERVER['EDITOR'];
64  } else {
65  $editor = 'vi';
66  }
67  }
68 
69  if (!empty($file)) {
70  $file = escapeshellarg($file);
71  }
72 
74  $editor . ' ' . $file . ' > `tty` < `tty`',
75  false
76  );
77  }
78 }
static open($file= '', $editor=null)
Definition: Editor.php:59
static execute($commandLine, $escape=true)
Definition: Processus.php:1165