<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>phundament manual: Docs For Class csstidy_optimise</title>
<meta http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<meta name="Author" content="Tobias Munk" />
<meta name="Subject" content="Web programming, PHP5 framework" />
<meta name="Language" content="en" />
<link rel="Shortcut Icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/media/style.css" />
<link rel="stylesheet" type="text/css" href="/media/manual.css" />
</head>
<body>
<div style="text-align:center" align="center" width="100%"><img src="/media/logo.png" style="margin: 15px 0 30px"></div>
<div id="page">
<div id="main">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="250" id="infobar">
<b>Packages:</b><br />
<a href="../li_lithron.html">lithron</a><br />
<a href="../li_csstidy.html">csstidy</a><br />
<br /><br />
<b>Classes:</b><br />
<div class="package">
<a href="../csstidy/csstidy.html">csstidy</a><br />
<a href="../csstidy/csstidy_optimise.html">csstidy_optimise</a><br />
<a href="../csstidy/csstidy_print.html">csstidy_print</a><br />
</div>
</td>
<td>
<table cellpadding="10" cellspacing="0" width="100%" border="0">
<!-- <tr><td valign="top" align="center">
<form type="get" action="/docs/manual/search.php">
Keyword <input type="text" name="keyword" size="50" />
<input type="submit" value="Search" />
</form>
</td></tr>-->
<tr><td valign="top"><!-- content begin -->
<h1>Class csstidy_optimise</h1>
<div class="inheritence-tree">
<pre></pre>
</div>
<div class="class-description">
<p>CSS Optimising Class</p>
<p>This class optimises CSS data generated by csstidy.</p></div>
<div class="tag-list">
<strong>Author:</strong>
Florian Schmitz (floele at gmail dot com) 2005-2006<br />
</div>
<hr size="1" noshade="noshade"/>
<a name="method-summary"></a>
<table class="method-summary" cellspacing="1">
<tr>
<th colspan="2">Method Summary</th>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
string
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methodcompress_important">compress_important</a>
( &$string, string $string)
</div>
<div class="description">
Removes unnecessary whitespace in ! important
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
string
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methodcompress_numbers">compress_numbers</a>
( string $subvalue)
</div>
<div class="description">
Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
string
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methodcut_color">cut_color</a>
( string $color)
</div>
<div class="description">
Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
array
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methoddissolve_4value_shorthands">dissolve_4value_shorthands</a>
( string $property, string $value)
</div>
<div class="description">
Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
array
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methoddissolve_short_bg">dissolve_short_bg</a>
( string $str_value)
</div>
<div class="description">
Dissolve background property
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
array
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methodexplode_ws">explode_ws</a>
( string $sep, string $string)
</div>
<div class="description">
Explodes a string as explode() does, however, not if $sep is escaped or within a string.
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
array
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methodmerge_4value_shorthands">merge_4value_shorthands</a>
( array $array)
</div>
<div class="description">
Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
array
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methodmerge_bg">merge_bg</a>
( array $input_css)
</div>
<div class="description">
Merges all background properties
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
array
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methodmerge_selectors">merge_selectors</a>
( &$array, array $array)
</div>
<div class="description">
Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red} Very basic and has at least one bug. Hopefully there is a replacement soon.
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
void
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methodpostparse">postparse</a>
()
</div>
<div class="description">
Optimises $css after parsing
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
string
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methodshorthand">shorthand</a>
( string $value)
</div>
<div class="description">
Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
void
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methodshorthands">shorthands</a>
()
</div>
<div class="description">
Optimises shorthands
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
void
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methodsubvalue">subvalue</a>
()
</div>
<div class="description">
Optimises a sub-value
</div>
</td>
</tr>
<tr>
<td class="type" nowrap="nowrap" width="1%">
void
</td>
<td>
<div class="declaration">
<a href="../csstidy/csstidy_optimise.html#methodvalue">value</a>
()
</div>
<div class="description">
Optimises values
</div>
</td>
</tr>
</table>
<hr size="1" noshade="noshade"/>
<a name="method-details"></a>
<table class="method-details" cellspacing="1">
<tr>
<th>Method Details</th>
</tr>
<tr>
<td class="method-data">
<a name="methodcompress_important"></a>
<h2>compress_important</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public string <strong>compress_important</strong></td>
<td width="100%">( &$string , string $string )</td>
</tr>
</table>
<p>Removes unnecessary whitespace in ! important</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Input</th></tr>
<tr><td valign="top"></td><td valign="top"><strong>&$string</strong><td valign="top"></td></tr>
<tr><td valign="top">string</td><td valign="top"><strong>$string</strong><td valign="top"></td></tr>
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methodcompress_numbers"></a>
<h2>compress_numbers</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public string <strong>compress_numbers</strong></td>
<td width="100%">(string $subvalue )</td>
</tr>
</table>
<p>Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Input</th></tr>
<tr><td valign="top">string</td><td valign="top"><strong>$subvalue</strong><td valign="top"></td></tr>
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methodcut_color"></a>
<h2>cut_color</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public string <strong>cut_color</strong></td>
<td width="100%">(string $color )</td>
</tr>
</table>
<p>Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Input</th></tr>
<tr><td valign="top">string</td><td valign="top"><strong>$color</strong><td valign="top"></td></tr>
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methoddissolve_4value_shorthands"></a>
<h2>dissolve_4value_shorthands</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public array <strong>dissolve_4value_shorthands</strong></td>
<td width="100%">(string $property , string $value )</td>
</tr>
</table>
<p>Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Input</th></tr>
<tr><td valign="top">string</td><td valign="top"><strong>$property</strong><td valign="top"></td></tr>
<tr><td valign="top">string</td><td valign="top"><strong>$value</strong><td valign="top"></td></tr>
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methoddissolve_short_bg"></a>
<h2>dissolve_short_bg</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public array <strong>dissolve_short_bg</strong></td>
<td width="100%">(string $str_value )</td>
</tr>
</table>
<p>Dissolve background property</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Input</th></tr>
<tr><td valign="top">string</td><td valign="top"><strong>$str_value</strong><td valign="top"></td></tr>
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methodexplode_ws"></a>
<h2>explode_ws</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public array <strong>explode_ws</strong></td>
<td width="100%">(string $sep , string $string )</td>
</tr>
</table>
<p>Explodes a string as explode() does, however, not if $sep is escaped or within a string.</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Input</th></tr>
<tr><td valign="top">string</td><td valign="top"><strong>$sep</strong><td valign="top">seperator</td></tr>
<tr><td valign="top">string</td><td valign="top"><strong>$string</strong><td valign="top"></td></tr>
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methodmerge_4value_shorthands"></a>
<h2>merge_4value_shorthands</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public array <strong>merge_4value_shorthands</strong></td>
<td width="100%">(array $array )</td>
</tr>
</table>
<p>Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Input</th></tr>
<tr><td valign="top">array</td><td valign="top"><strong>$array</strong><td valign="top"></td></tr>
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methodmerge_bg"></a>
<h2>merge_bg</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public array <strong>merge_bg</strong></td>
<td width="100%">(array $input_css )</td>
</tr>
</table>
<p>Merges all background properties</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Input</th></tr>
<tr><td valign="top">array</td><td valign="top"><strong>$input_css</strong><td valign="top"></td></tr>
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methodmerge_selectors"></a>
<h2>merge_selectors</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public array <strong>merge_selectors</strong></td>
<td width="100%">( &$array , array $array )</td>
</tr>
</table>
<p>Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red} Very basic and has at least one bug. Hopefully there is a replacement soon.</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Input</th></tr>
<tr><td valign="top"></td><td valign="top"><strong>&$array</strong><td valign="top"></td></tr>
<tr><td valign="top">array</td><td valign="top"><strong>$array</strong><td valign="top"></td></tr>
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methodpostparse"></a>
<h2>postparse</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public void <strong>postparse</strong></td>
<td width="100%">()</td>
</tr>
</table>
<p>Optimises $css after parsing</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methodshorthand"></a>
<h2>shorthand</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public string <strong>shorthand</strong></td>
<td width="100%">(string $value )</td>
</tr>
</table>
<p>Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Input</th></tr>
<tr><td valign="top">string</td><td valign="top"><strong>$value</strong><td valign="top"></td></tr>
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methodshorthands"></a>
<h2>shorthands</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public void <strong>shorthands</strong></td>
<td width="100%">()</td>
</tr>
</table>
<p>Optimises shorthands</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methodsubvalue"></a>
<h2>subvalue</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public void <strong>subvalue</strong></td>
<td width="100%">()</td>
</tr>
</table>
<p>Optimises a sub-value</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
<tr>
<td class="method-data">
<a name="methodvalue"></a>
<h2>value</h2>
<table class="method-detail" cellspacing="0">
<tr>
<td nowrap="nowrap">public void <strong>value</strong></td>
<td width="100%">()</td>
</tr>
</table>
<p>Optimises values</p>
<div class="tag-list"><table class="method-summary" cellspacing="1">
<tr><th colspan="3" class="small">Output</th></tr>
<tr><th colspan="3" class="small">Exception</th></tr>
</table></div>
<p/>
</td>
</tr>
</table>
<!-- content end --></td></tr></table>
</td>
</tr>
</table>
</div><!-- main -->
<div id="footer">
Copyright © 2007 - <a title="diemeisterei" href="http://www.diemeisterei.de/">diemeisterei GmbH</a><br/>
<a title="phundament" href="http://www.phundament.com/">phundament</a>
</div>
</div><!-- page -->
</body>
</html>