3
abstract class FILTER extends VIRTUALStreamReaderWriter implements STREAMObjectInterface {
8
var $content_type = "application/binary";
9
var $extension = false;
10
var $specials = false;
14
var $filewriter = false;
15
var $filereader = false;
18
var $filemode = false;
20
function __construct(&$info = NULL, STREAMWriterInterface $output = NULL) {
23
if (isset($info['joiner']))
24
$this->joiner = $info['joiner'];
26
if (isset($info['content_type']))
27
$this->content_type = $info['content_type'];
29
if (isset($info['extension']))
30
$this->extension = $info['extension'];
32
$this->output = $output;
35
function SetOutput(STREAMWriterInterface $output = NULL) {
36
$this->output = $output;
39
function Open(&$args = NULL) {
40
if ($this->filewriter) {
41
if (($args)&&($args['tmpfile'])) $this->tmpfile = $args['tmpfile'];
42
else $this->tmpfile = GetTmpFile("adei_appfilter_", $this->GetExtension());
47
function Close(STREAMWriterInterface $h = NULL) {
48
if ($this->filewriter) {
49
if ($this->output) $h = $this->output;
51
if ($this->filemode) {
52
if ($h) $h->WriteData($this->tmpfile);
53
else throw new ADEIException(translate("The STREAM should be supplied to the FILTER while operating in the filemode"));
55
if ($h) $h->WriteFile($this->tmpfile);
56
return file_get_contents($this->tmpfile);
58
unlink($this->tmpfile);
62
function BlockStart(&$args = NULL) {
65
function BlockEnd(STREAMWriterInterface $h = NULL) {
69
function ReadData($limit = 0) {
70
if ($this->filewriter)
73
throw new ADEIException(translate("The ReadData function is not implemented within FILTER class"));
77
if ($this->filewriter)
80
throw new ADEIException(translate("The EOS function is not implemented within FILTER class"));
83
function GetSpecials() {
84
return $this->specials;
87
function GetContentType() {
88
return $this->content_type;
91
function GetExtension() {
92
return $this->extension;
99
function RequestFilemode() {
100
if ($this->filewriter) {
101
$this->filemode = true;
109
require("iofilter.php");
110
require("appfilter.php");
111
require("zipfilter.php");
b'\\ No newline at end of file'