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 32 33 34 35 36 37 38 39 40 41
|
<?php
namespace phpdotnet\phd;
class TestGenericChunkedXHTML extends Package_Generic_ChunkedXHTML {
public function __construct(
Config $config,
OutputHandler $outputHandler
) {
parent::__construct($config, $outputHandler);
}
public function update($event, $value = null) {
switch($event) {
case Render::CHUNK:
parent::update($event, $value);
break;
case Render::STANDALONE:
parent::update($event, $value);
break;
case Render::INIT:
$this->setOutputDir($this->config->output_dir() . strtolower($this->getFormatName()) . '/');
break;
//No verbose
}
}
public function writeChunk($id, $fp) {
$filename = $this->getOutputDir() . $id . $this->getExt();
rewind($fp);
$content = "\n";
$content .= stream_get_contents($fp);
if ($id === "") {
$filename = $this->config->xml_file();
}
echo "Filename: " . basename($filename) . "\n";
echo "Content:" . $content . "\n";
}
}
|