mirror of
https://github.com/inigoflores/ds-codigos-postales-ine-es.git
synced 2024-06-07 13:45:26 +02:00
30 lines
640 B
PHP
30 lines
640 B
PHP
<?php
|
|
/*
|
|
* This file is part of the ConsoleKit package.
|
|
*
|
|
* (c) 2012 Maxime Bouroumeau-Fuseau
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace ConsoleKit;
|
|
|
|
/**
|
|
* Text writer that writes to stdout or stderr
|
|
*/
|
|
class StdTextWriter implements TextWriter
|
|
{
|
|
public function write($text, $pipe = TextWriter::STDOUT)
|
|
{
|
|
$f = fopen('php://' . $pipe, 'w');
|
|
fwrite($f, $text);
|
|
fclose($f);
|
|
}
|
|
|
|
public function writeln($text = '', $pipe = TextWriter::STDOUT)
|
|
{
|
|
$this->write("$text\n", $pipe);
|
|
}
|
|
}
|