<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 20 Nov 2008 07:40:46 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Kae Verens' Blog: efficient JS minification using PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10232</guid>
      <link>http://www.phpdeveloper.org/news/10232</link>
      <description><![CDATA[<p>
In a <a href="http://verens.com/archives/2008/05/20/efficient-js-minification-using-php/">new post</a> today, <i>Kae Verens</i> takes a look at a method for easy and quick javascript minification with help from a little bit of PHP.
</p>
<blockquote>
A useful part of minification is that during the act of compiling your minified source, you can also pull in other JavaScript files and compiled them all into one single source. This has a major advantage that there is only one file to download.
</blockquote>
<p>
The <a href="http://verens.com/archives/2008/05/20/efficient-js-minification-using-php/">method</a> runs a <a href="http://www.php.net/file_get_contents">file_get_contents</a> on each of the javascript files, and pulls their content into a single PHP variable. This value is then just echoed out after it's passes through <a href="http://code.google.com/p/jsmin-php/">this minimizer class</a>. 
</p>
<p>
<i>Kae</i> also offers an alternative to performing this expensive operation each time - caching then checking the md5 hash of the cache to see if it's different than the current version. Example code is included.
</p>]]></description>
      <pubDate>Wed, 21 May 2008 10:25:35 -0500</pubDate>
    </item>
  </channel>
</rss>
