1
0
mirror of https://github.com/php/phd.git synced 2026-03-24 07:02:07 +01:00
Files
archived-phd/phpdotnet/phd/TestPHPChunkedXHTML.php
2024-12-29 19:58:10 +00:00

42 lines
1.1 KiB
PHP

<?php
namespace phpdotnet\phd;
class TestPHPChunkedXHTML extends Package_PHP_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->outputDir . 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->xmlFile;
}
echo "Filename: " . basename($filename) . "\n";
echo "Content:" . $content . "\n";
}
}