1 | <?php |
||
15 | class SimpleFileWriter extends OutputStreamWriter |
||
16 | { |
||
17 | /** |
||
18 | * @var string ファイルパス |
||
19 | */ |
||
20 | private $filepath; |
||
21 | |||
22 | /** |
||
23 | * @var int バッファリングサイズ |
||
24 | */ |
||
25 | private $bufferSize; |
||
26 | |||
27 | /** |
||
28 | * @var string 書き込みモード |
||
29 | */ |
||
30 | private $mode; |
||
31 | |||
32 | /** |
||
33 | * constructor |
||
34 | * @param string $filepath ファイルパス |
||
35 | * @param int $bufferSize バッファリングサイズ |
||
36 | */ |
||
37 | public function __construct($filepath, $bufferSize = null) |
||
49 | |||
50 | /** |
||
51 | * ファイルに書き込む |
||
52 | * ファイルが存在する場合、常に追記モード |
||
53 | * @param mixed $data 書き込みデータ |
||
54 | */ |
||
55 | public function write($data) |
||
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | public function close() |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | public function flush() |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function newLine() |
||
105 | } |
||
106 |