<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Just a bunch of code &#187; css</title>
	<atom:link href="http://www.bunchacode.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bunchacode.com</link>
	<description></description>
	<lastBuildDate>Sun, 11 Sep 2011 19:56:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>get cakephp build-in css compression to work</title>
		<link>http://www.bunchacode.com/programming/get-cakephp-build-in-css-compression-to-work/</link>
		<comments>http://www.bunchacode.com/programming/get-cakephp-build-in-css-compression-to-work/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 19:45:41 +0000</pubDate>
		<dc:creator>Funky Dude</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.bunchacode.com/?p=194</guid>
		<description><![CDATA[Since cakephp 1.3, build-in css compression has stopped working. at least for me. however, it&#8217;s very easy to get it working again. Step 1: grab csspp from here and put it in your vendor directory so it looks something like this (app/vendors/csspp/csspp.php) Step 2: in your core.php file in app/config, uncomment Configure::write(&#8216;Asset.filter.css&#8217;, &#8216;css.php&#8217;); Step 3: [...]]]></description>
			<content:encoded><![CDATA[<p>Since cakephp 1.3, build-in css compression has stopped working. at least for me. however, it&#8217;s very easy to get it working again.</p>
<p><strong>Step 1:</strong></p>
<p>grab csspp from <a href="http://github.com/jeremyboles/csspp/blob/master/csspp.php" target="_blank">here</a> and put it in your vendor directory so it looks something like this (app/vendors/csspp/csspp.php)</p>
<p><strong>Step 2:</strong></p>
<p>in your core.php file in app/config, uncomment <strong>Configure::write(&#8216;Asset.filter.css&#8217;, &#8216;css.php&#8217;);</strong></p>
<p><strong>Step 3:</strong></p>
<p>in your css.php under app/webroot,  modify make_clean_css function so that it looks something like this</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre>
<pre><span class="php"><span class="php-function">function</span> make_clean_css<span class="php-brackets">(</span><span class="php-var">$path</span>, <span class="php-var">$name</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
App<span class="php-operator">:</span><span class="php-operator">:</span>import<span class="php-brackets">(</span><span class="php-string">'Vendor'</span>, <span class="php-string">'csspp'</span> <span class="php-operator">.</span> DS <span class="php-operator">.</span> <span class="php-string">'csspp'</span><span class="php-brackets">)</span>;
<span class="php-var">$data</span> <span class="php-operator">=</span> <span class="php-function">file_get_contents</span><span class="php-brackets">(</span><span class="php-var">$path</span><span class="php-brackets">)</span>;
<span class="php-var">$csspp</span> <span class="php-operator">=</span> <span class="php-keyword">new</span> csspp<span class="php-brackets">(</span><span class="php-var">$name</span>,<span class="php-string">''</span><span class="php-brackets">)</span>;
<span class="php-var">$output</span> <span class="php-operator">=</span> <span class="php-var">$csspp</span><span class="php-operator">-</span><span class="php-operator">&amp;</span>gt;process<span class="php-brackets">(</span><span class="php-brackets">)</span>;
<span class="php-var">$ratio</span> <span class="php-operator">=</span> <span class="php-number">1</span><span class="php-number">0</span><span class="php-number">0</span> <span class="php-operator">-</span> <span class="php-brackets">(</span><span class="php-function">round</span><span class="php-brackets">(</span><span class="php-function">strlen</span><span class="php-brackets">(</span><span class="php-var">$output</span><span class="php-brackets">)</span> <span class="php-operator">/</span> <span class="php-function">strlen</span><span class="php-brackets">(</span><span class="php-var">$data</span><span class="php-brackets">)</span>, <span class="php-number">3</span><span class="php-brackets">)</span> <span class="php-operator">*</span> <span class="php-number">1</span><span class="php-number">0</span><span class="php-number">0</span><span class="php-brackets">)</span>;
<span class="php-var">$output</span> <span class="php-operator">=</span> <span class="php-string">&quot; /* file: $name, ratio: $ratio% */ &quot;</span> <span class="php-operator">.</span> <span class="php-var">$output</span>;
<span class="php-keyword">return</span> <span class="php-var">$output</span>;
<span class="php-brackets">}</span></span></pre>
</div>
<p>and that should be it. if it doesnt work for some reason,</p>
<p>change  line 82 in your app/webroot/css.php to</p>
<p><strong>if (file_exists($cachepath) &amp;&amp; 0)</strong></p>
<p>so you won&#8217;t be looking at cached file when u debug.<strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bunchacode.com/programming/get-cakephp-build-in-css-compression-to-work/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

