XRL
3.0.0
Simple XML-RPC Library (both client and server)
Main Page
Classes
Files
Examples
File List
Output.php
1
<?php
2
/*
3
* This file is part of XRL, a simple XML-RPC Library for PHP.
4
*
5
* Copyright (c) 2012, XRL Team. All rights reserved.
6
* XRL is licensed under the 3-clause BSD License.
7
*
8
* For the full copyright and license information, please view the LICENSE
9
* file that was distributed with this source code.
10
*/
11
12
namespace
fpoirotte\XRL;
13
21
class
Output
22
{
24
protected
$stream
;
25
33
public
function
__construct
(
$stream
)
34
{
35
if
(@stream_get_meta_data(
$stream
) === null) {
36
throw
new \InvalidArgumentException(
'Not a valid stream'
);
37
}
38
39
$this->stream =
$stream
;
40
}
41
59
public
function
write
($format
/* , ... */
)
60
{
61
$args = func_get_args();
62
array_shift($args);
63
// Protection against format attacks.
64
if
(!count($args)) {
65
$args[] = $format;
66
$format =
"%s"
;
67
}
68
vfprintf($this->stream, $format . PHP_EOL, $args);
69
}
70
}
fpoirotte\XRL\Output\$stream
$stream
Stream to send the messages to.
Definition:
Output.php:24
fpoirotte\XRL\Output\__construct
__construct($stream)
Definition:
Output.php:33
fpoirotte\XRL\Output\write
write($format)
Definition:
Output.php:59
fpoirotte\XRL\Output
A class that formats messages before sending them to a stream.
Definition:
Output.php:21
src
Output.php
Generated on Sat Oct 29 2016 15:08:07 for XRL by
1.8.6