function csstidy::write in Advanced CSS/JS Aggregation 6
Write plain output to a file
@access public @version 1.4
Parameters
string $filename:
bool $formatted whether to print formatted or not:
string $doctype when printing formatted, is a shorthand for the document type:
bool $externalcss when printing formatted, indicates whether styles to be attached internally or as an external stylesheet:
string $title when printing formatted, is the title to be added in the head of the document:
string $lang when printing formatted, gives a two-letter language code to be added to the output:
bool $pre_code whether to add pre and code tags around the code (for light HTML formatted templates):
1 call to csstidy::write()
- csstidy::write_page in advagg_css_compress/
csstidy/ class.csstidy.inc - Write formatted output to a file
File
- advagg_css_compress/
csstidy/ class.csstidy.inc, line 473
Class
- csstidy
- CSS Parser class
Code
function write($filename, $formatted = false, $doctype = 'xhtml1.1', $externalcss = true, $title = '', $lang = 'en', $pre_code = true) {
$filename .= $formatted ? '.xhtml' : '.css';
if (!is_dir('temp')) {
$madedir = mkdir('temp');
if (!$madedir) {
print 'Could not make directory "temp" in ' . dirname(__FILE__);
exit;
}
}
$handle = fopen('temp/' . $filename, 'w');
if ($handle) {
if (!$formatted) {
fwrite($handle, $this->print
->plain());
}
else {
fwrite($handle, $this->print
->formatted_page($doctype, $externalcss, $title, $lang, $pre_code));
}
}
fclose($handle);
}