当前位置: 首页>>代码示例>>PHP>>正文


PHP Process::close方法代码示例

本文整理汇总了PHP中Process::close方法的典型用法代码示例。如果您正苦于以下问题:PHP Process::close方法的具体用法?PHP Process::close怎么用?PHP Process::close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Process的用法示例。


在下文中一共展示了Process::close方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _sendCommand

 /**
  * @param $command
  * @param $string
  */
 protected function _sendCommand($command, $string)
 {
     $process = new Process($command, $this->_globalDictionary);
     $process->write($string);
     $this->_raw = $process->read();
     $process->close();
 }
开发者ID:indynagpal,项目名称:MateCat,代码行数:11,代码来源:HunspellShell.php

示例2: getTitle

 /**
  * Get the terminal title.
  * @return string
  */
 public static function getTitle()
 {
     if (!empty(self::$username)) {
         $process = new Process("uname -n");
         $title = self::$username . "@" . trim($process->get());
         $process->close();
         return $title;
     } else {
         return "not logged shell - how cold it be possible, uh?";
     }
 }
开发者ID:anonymframework,项目名称:xwiterm,代码行数:15,代码来源:terminal.class.php

示例3: diff

 /**
  * Produce diff between the contents
  *
  * @param   string left
  * @param   string right
  */
 protected function diff($left, $right)
 {
     with($templ = new TempFile(), $tempr = new TempFile(), $templ->open(FILE_MODE_WRITE), $tempr->open(FILE_MODE_WRITE));
     $templ->write($left);
     $tempr->write($right);
     $templ->close();
     $tempr->close();
     // TODO: Implement "diff" in userland
     try {
         $p = new Process(sprintf('diff -u %s %s', $templ->getURI(), $tempr->getURI()));
         $p->in->close();
         while (!$p->out->eof()) {
             $this->out->writeLine($p->out->readLine());
         }
         $p->close();
     } catch (IOException $e) {
         $this->err->writeLine('!=> Invocation of `diff` program failed.');
         $templ->unlink();
         $tempr->unlink();
         return;
     }
     $templ->unlink();
     $tempr->unlink();
 }
开发者ID:Gamepay,项目名称:xp-framework,代码行数:30,代码来源:DiffInstruction.class.php

示例4: json_encode

echo '<hr>';
//$p->put(chr(21));
//var_dump($p->close());
//echo json_encode($p->getStatus());
//echo '<hr>';
// $p->put("whoami");
// $p->put(chr(13));
//echo $p->get();
usleep(500000);
echo $p->get();
$p->put("whoami");
$p->put(chr(13));
echo $p->get();
echo '<hr>';
usleep(500000);
echo $p->get();
echo '<hr>';
echo json_encode($p->getStatus());
echo '<hr>';
$p->put("ls -l");
$p->put(chr(13));
echo $p->get();
echo '<hr>';
usleep(500000);
echo $p->get();
echo '<hr>';
usleep(500000);
echo $p->get();
echo '<hr>';
echo "END " . ($p->close() ? 'NOT VALID USER OR PASSWORD' : 'SUCC LOG IN');
开发者ID:kenichiii,项目名称:online-php-ide-pfc-editor,代码行数:30,代码来源:wtest.php

示例5: hugeStderr

 public function hugeStderr()
 {
     $p = new Process($this->executable(), $this->arguments('-r', 'fputs(STDERR, str_repeat("*", 65536));'));
     $err = '';
     while (!$p->err->eof()) {
         $err .= $p->err->read();
     }
     $p->close();
     $this->assertEquals(65536, strlen($err));
 }
开发者ID:xp-framework,项目名称:core,代码行数:10,代码来源:ProcessTest.class.php


注:本文中的Process::close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。