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


PHP StreamOutput::getStream方法代码示例

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


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

示例1: testFormattedEscapedOutput

 public function testFormattedEscapedOutput()
 {
     $output = new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, true, null);
     $output->writeln('<info>' . OutputFormatter::escape('<error>some error</error>') . '</info>');
     rewind($output->getStream());
     $this->assertSame("[32m<error>some error</error>[39m" . PHP_EOL, stream_get_contents($output->getStream()));
 }
开发者ID:tronsha,项目名称:cerberus,代码行数:7,代码来源:ConsoleTest.php

示例2: testDoWrite

 public function testDoWrite()
 {
     $output = new StreamOutput($this->stream);
     $output->writeln('foo');
     rewind($output->getStream());
     $this->assertEquals('foo' . PHP_EOL, stream_get_contents($output->getStream()), '->doWrite() writes to the stream');
 }
开发者ID:Ener-Getick,项目名称:symfony,代码行数:7,代码来源:StreamOutputTest.php

示例3: getDisplay

 /**
  * @param boolean
  *
  * @return string
  */
 public function getDisplay($normalize = false)
 {
     rewind($this->output->getStream());
     $display = stream_get_contents($this->output->getStream());
     if ($normalize) {
         $display = str_replace(PHP_EOL, "\n", $display);
     }
     return $display;
 }
开发者ID:burimshala,项目名称:numbertowords,代码行数:14,代码来源:ApplicationTester.php

示例4: getRawCommandOutput

 /**
  * @return string
  *
  * @throws \Exception
  */
 private function getRawCommandOutput()
 {
     if (!$this->output) {
         throw new \Exception('No command output!');
     }
     rewind($this->output->getStream());
     return stream_get_contents($this->output->getStream());
 }
开发者ID:lafourchette,项目名称:FriendlyContexts,代码行数:13,代码来源:CommandContext.php

示例5: readOutput

 /**
  * Returns the contents of the output stream.
  *
  * @param StreamOutput $output The output manager.
  *
  * @return string The contents of the stream.
  */
 public function readOutput(StreamOutput $output)
 {
     $contents = '';
     $stream = $output->getStream();
     rewind($stream);
     do {
         $contents .= fgets($stream);
     } while (!feof($stream));
     return $contents;
 }
开发者ID:bangpound,项目名称:console,代码行数:17,代码来源:CommandTestCase.php

示例6: getOutputBuffer

 /**
  * helper method to get output as string out of a StreamOutput
  *
  * @param $output
  *
  * @return string all output
  */
 protected function getOutputBuffer(StreamOutput $output)
 {
     $handle = $output->getStream();
     rewind($handle);
     $display = stream_get_contents($handle);
     // Symfony2's StreamOutput has a hidden dependency on PHP_EOL which needs to be removed by
     // normalizing it to the standard newline for text here.
     $display = strtr($display, array(PHP_EOL => "\n"));
     return $display;
 }
开发者ID:netz98,项目名称:n98-magerun,代码行数:17,代码来源:TestCase.php

示例7: readOutput

 /**
  * Reads the contents of an output stream.
  *
  * @param StreamOutput $output The stream output manager.
  *
  * @return string The contents of the stream.
  */
 protected function readOutput(StreamOutput $output)
 {
     $stream = $output->getStream();
     $contents = '';
     rewind($stream);
     do {
         $contents .= fgets($stream);
     } while (!feof($stream));
     fclose($stream);
     return $contents;
 }
开发者ID:box-project,项目名称:box3,代码行数:18,代码来源:AbstractCommandTestCase.php

示例8: __construct

 /**
  * Constructor.
  *
  * @param StreamOutput $output
  */
 public function __construct(StreamOutput $output)
 {
     parent::__construct($output->getStream());
 }
开发者ID:jordeytje,项目名称:vlamteddybeer,代码行数:9,代码来源:PassthruPager.php

示例9: __construct

 /**
  * Constructor.
  *
  * @param StreamOutput $output        	
  * @param string $cmd
  *        	Pager process command (default: 'less -R -S -F -X')
  */
 public function __construct(StreamOutput $output, $cmd = 'less -R -S -F -X')
 {
     $this->stream = $output->getStream();
     $this->cmd = $cmd;
 }
开发者ID:sapwoo,项目名称:portfolio,代码行数:12,代码来源:ProcOutputPager.php

示例10: getDisplay

 /**
  * Gets the display from the stream output.
  *
  * @return string
  */
 protected function getDisplay(StreamOutput $output)
 {
     rewind($output->getStream());
     return stream_get_contents($output->getStream());
 }
开发者ID:maartenstaa,项目名称:phpta,代码行数:10,代码来源:ProjectTest.php

示例11: assertOutputContains

 private function assertOutputContains($expected, StreamOutput $output)
 {
     rewind($output->getStream());
     $stream = stream_get_contents($output->getStream());
     $this->assertContains($expected, $stream);
 }
开发者ID:ayoah,项目名称:symfony,代码行数:6,代码来源:SymfonyQuestionHelperTest.php

示例12: isTtyTerminal

 /**
  * See if stream output is a tty terminal.
  *
  * @return bool
  */
 private function isTtyTerminal(StreamOutput $output)
 {
     $tty = function_exists('posix_isatty') && @posix_isatty($output->getStream());
     if ($tty) {
         putenv("PERIDOT_TTY=1");
     }
     return $tty;
 }
开发者ID:peridot-php,项目名称:peridot-reporters,代码行数:13,代码来源:AbstractBaseReporter.php

示例13: getOutputStreamContent

 public function getOutputStreamContent(StreamOutput $streamOutput)
 {
     $stream = $streamOutput->getStream();
     rewind($stream);
     return stream_get_contents($stream);
 }
开发者ID:pavsuri,项目名称:PARMT,代码行数:6,代码来源:MigrationTestCase.php

示例14: functionalAsserts

 /**
  * @param StreamOutput $output
  */
 private function functionalAsserts(StreamOutput $output)
 {
     $baseDir = realpath(__DIR__ . '/..');
     rewind($output->getStream());
     $content = stream_get_contents($output->getStream());
     $this->assertContains('Running the fsTest job > Filesystem Block Tests', $content);
     $this->assertContains('Creating tmp/', $content);
     $this->assertFileExists($baseDir . '/tmp');
     $this->assertContains('Creating tmp/test/deep', $content);
     $this->assertFileExists($baseDir . '/tmp/test');
     $this->assertFileExists($baseDir . '/tmp/test/deep');
     $this->assertContains('Touching tmp/test.tmp', $content);
     $this->assertFileExists($baseDir . '/tmp/test.tmp');
     $this->assertContains('Touching tmp/test/deep/test.tmp', $content);
     $this->assertFileExists($baseDir . '/tmp/test/deep/test.tmp');
     $this->assertContains('Running the lint job > Lints the files of the project', $content);
     $this->assertContains('Lint Task Finished', $content);
     $this->assertContains('Build Success!', $content);
 }
开发者ID:kangkot,项目名称:bldr,代码行数:22,代码来源:ApplicationTest.php

示例15: getOutputContent

 protected function getOutputContent(StreamOutput $output)
 {
     rewind($output->getStream());
     return str_replace(PHP_EOL, "\n", stream_get_contents($output->getStream()));
 }
开发者ID:sintoris,项目名称:Known,代码行数:5,代码来源:TableTest.php


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