blob: 52e4c835b2e97315642f5e6e52c2c67fb078c9ad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<?php
/**
* The basic Result class for the Img2Ascii processor.
*
* It defines common output functions for the implementing output
* transformers.
*
* (c) 2016 Alex Schenkel
*/
namespace Img2Ascii;
class Result {
public $ascii;
public function __construct(&$ascii) {
$this->ascii =& $ascii;
}
public function writeFile($path, $lineEnding = "\n") {
$fh = fopen($path,'w');
foreach($this->ascii as $line) {
foreach($line as $value) {
$value = $this->transformValue($value);
fputs($fh, $value);
}
fputs($fh,$lineEnding);
}
fclose($fh);
return $this;
}
}
|