示例#1
0
文件: help.php 项目: Jaace/wp-cli
 private static function pass_through_pager($out)
 {
     $pager = Utils\is_windows() ? 'more' : 'less -r';
     // convert string to file handle
     $fd = fopen("php://temp", "r+");
     fputs($fd, $out);
     rewind($fd);
     $descriptorspec = array(0 => $fd, 1 => STDOUT, 2 => STDERR);
     return proc_close(proc_open($pager, $descriptorspec, $pipes));
 }
示例#2
0
 private static function pass_through_pager($out)
 {
     if (Utils\is_windows()) {
         // no paging for Windows cmd.exe; sorry
         echo $out;
         return 0;
     }
     // convert string to file handle
     $fd = fopen("php://temp", "r+");
     fputs($fd, $out);
     rewind($fd);
     $descriptorspec = array(0 => $fd, 1 => STDOUT, 2 => STDERR);
     return proc_close(proc_open('less -r', $descriptorspec, $pipes));
 }
示例#3
0
 private function init_colorization()
 {
     if ('auto' === $this->config['color']) {
         $this->colorize = !\cli\Shell::isPiped() && !\WP_CLI\Utils\is_windows();
     } else {
         $this->colorize = $this->config['color'];
     }
 }