コード例 #1
0
 /**
  * Flush buffer, optionally tidy up HTML, and close output if it's not to a php stream
  */
 public function flush()
 {
     if ($this->out && strncmp($this->outTarget, 'php://', 6) !== 0) {
         fclose($this->out);
     }
     if ($this->printsHTML === true && $this->outTarget !== null && strpos($this->outTarget, 'php://') !== 0 && strpos($this->outTarget, 'socket://') !== 0 && extension_loaded('tidy')) {
         file_put_contents($this->outTarget, tidy_repair_file($this->outTarget, array('indent' => true, 'wrap' => 0), 'utf8'));
     }
 }
コード例 #2
0
ファイル: Printer.php プロジェクト: proofek/phpunit
 /**
  * Flush buffer, optionally tidy up HTML, and close output.
  */
 public function flush()
 {
     if ($this->out && $this->outTarget !== 'php://stderr') {
         fclose($this->out);
     }
     if ($this->printsHTML === TRUE && $this->outTarget !== NULL && strpos($this->outTarget, 'php://') !== 0 && strpos($this->outTarget, 'socket://') !== 0 && extension_loaded('tidy')) {
         file_put_contents($this->outTarget, tidy_repair_file($this->outTarget, array('indent' => TRUE, 'wrap' => 0), 'utf8'));
     }
 }
コード例 #3
0
ファイル: Printer.php プロジェクト: xiplias/pails
 /**
  * Flush buffer, optionally tidy up HTML, and close output.
  *
  */
 public function flush()
 {
     if ($this->out !== NULL) {
         fclose($this->out);
     }
     if ($this->printsHTML === TRUE && $this->outTarget !== NULL && extension_loaded('tidy')) {
         file_put_contents($this->outTarget, tidy_repair_file($this->outTarget));
     }
 }
コード例 #4
0
<?php

$l = 1;
$s = "";
$a = array();
tidy_repair_string($s, $l, $l, $l);
tidy_repair_string($s, $s, $s, $s);
tidy_repair_string($l, $l, $l, $l);
tidy_repair_string($a, $a, $a, $a);
tidy_repair_file($s, $l, $l, $l);
tidy_repair_file($s, $s, $s, $s);
tidy_repair_file($l, $l, $l, $l);
tidy_repair_file($a, $a, $a, $a);
echo "Done\n";
コード例 #5
0
<?php

$fixed = tidy_repair_file('bad.html');
file_put_contents('good.html', $fixed);
コード例 #6
0
<?php

$config = array('output-xhtml' => true);
$fixed = tidy_repair_file('bad.html', $config);
file_put_contents('good.xhtml', $fixed);
コード例 #7
0
ファイル: tidy.php プロジェクト: xiaobudongzhang/lib
<?php

$fix_html = tidy_repair_file('bad.html');
echo $fix_html;