<?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>Dmitri's Blog &#187; development</title>
	<atom:link href="http://www.dmitri.me/blog/tag/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dmitri.me/blog</link>
	<description>Dmitri Smirnov. Web development in Estonia.</description>
	<lastBuildDate>Tue, 10 Aug 2010 12:07:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Plugin &#8216;Minify&#8217; for Frog CMS</title>
		<link>http://www.dmitri.me/blog/plugin-minify-for-frog-cms/</link>
		<comments>http://www.dmitri.me/blog/plugin-minify-for-frog-cms/#comments</comments>
		<pubDate>Wed, 20 May 2009 09:25:46 +0000</pubDate>
		<dc:creator>Dmitri</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[frog cms]]></category>

		<guid isPermaLink="false">http://www.dmitri.me/blog/?p=235</guid>
		<description><![CDATA[About Minify
&#8216;Minify&#8217; is a plugin to minify JavaScript and/or CSS code and combine it
into one file on the fly. This will increase performance of website.
So you don&#8217;t need to do dozens HTTP request for every JavaScript or CSS file.
Minify plugin is more useful and faster with Funky cache plugin.

Usage
Install the minify plugin to your Frog [...]]]></description>
			<content:encoded><![CDATA[<h1>About Minify</h1>
<p>&#8216;Minify&#8217; is a plugin to minify JavaScript and/or CSS code and combine it<br />
into one file on the fly. This will increase performance of website.<br />
So you don&#8217;t need to do dozens HTTP request for every JavaScript or CSS file.<br />
Minify plugin is more useful and faster with <a href="http://www.appelsiini.net/projects/funky_cache">Funky cache</a> plugin.</p>
<p><span id="more-235"></span></p>
<h1>Usage</h1>
<p>Install the minify plugin to your Frog CMS plugins directory:</p>
<pre><code>
$cd /path/to/frog/plugins/
$git clone git://github.com/dknight/minify.git
</code></pre>
<h3>Activate minify plugin</h3>
<p><img src="http://www.dmitri.me/misc/minify.png" alt="" /></p>
<h3>Set the settings</h3>
<p>So next step you need to create &#8216;cache&#8217; directory in your document root and make it<br />
writable. Due to security settings most webservers doesn&#8217;t allow you to create<br />
directories dynamically, so you need to create it manually. Create it in your DOCUMENT_ROOT/cache/ and set writtable permissions.</p>
<pre><code>
$mkdir /website/root/cache/
$chmod 0666 /website/root/cache/
</code></pre>
<h3>Usage in Frog CMS</h3>
<pre><code>
&lt;?php
$jsFiles = array(
    '/public/javascripts/jquery-1.3.2.min.js',
    '/public/javascripts/jquery.validate.min.js',
    '/public/javascripts/jquery.form.js',
    '/public/javascripts/frog.js'
);
$cssFiles = array(
    'path/to/master.css',
    'path/to/subpage.css',
    'path/to/ie-fix.css'
);

$js_minify  = Minify::factory('js');
$css_minify = Minify::factory('css');
?&gt;
</code></pre>
<p>HTML:</p>
<pre><code>

...
&lt;link href="&lt;?php echo $css_minify-&gt;minify($cssFiles, true); ?&gt;" rel="stylesheet" type="text/css" /&gt;
...
&lt;script type="text/javascript" src="&lt;?php echo $js_minify-&gt;minify($files, true); ?&gt;"&gt;&lt;/script&gt;
...

</code></pre>
<p>The &#8216;minify&#8217; method can pass 3 parameters:</p>
<table border="1">
<tbody>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default</th>
</tr>
<tr>
<td>files</td>
<td>File to be minified</td>
<td>array [required]</td>
<td>array()</td>
</tr>
<tr>
<td>output</td>
<td>Output to file or raw output into string</td>
<td>boolean [optional]</td>
<td>false</td>
</tr>
<tr>
<td>fileName</td>
<td>Name of output file</td>
<td>string [optional]</td>
<td>&#8216;min.js&#8217; or &#8216;min.css&#8217;</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.dmitri.me/blog/plugin-minify-for-frog-cms/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
