<?xml version="1.0" encoding="UTF-8"?>
<config>
  <!-- Sources -->
  <sources>
    <source name="drupal" scanPath="/htdocs/drupal" documentRoot="/htdocs" basePath="/drupal/" />
  </sources>

  <!-- Servers -->
  <servers>
    <server name="origin pull cdn" transporter="symlink_or_copy">
      <location>/htdocs/static.example.com</location>
      <url>http://localhost/static.example.com/</url>
    </server>
    <server name="ftp push cdn" transporter="ftp" maxConnections="5">
      <host>localhost</host>
      <username>daemontest</username>
      <password>daemontest</password>
      <url>http://localhost/daemontest/</url>
    </server>
  </servers>

  <!-- Rules -->
  <rules>
    <!--
    Add all JavasSript, CSS, image and flash files from the most common
    directories in Drupal. Don't forget to add your site-specific directories!
    -->
    <rule for="drupal" label="JS, CSS, images, fonts and Flash">
      <filter>
        <paths>misc:profiles:modules:themes:sites/all:sites/default:sites/YOURSITE.COM</paths>
        <extensions>ico:js:css:gif:png:jpg:jpeg:svg:otf:ttf:swf</extensions>
        <ignoredDirs>CVS:.svn</ignoredDirs>
      </filter>
      <processorChain>
        <processor name="image_optimizer.KeepFilename" />
        <processor name="yui_compressor.YUICompressor" />
        <processor name="link_updater.CSSURLUpdater" />
        <processor name="unique_filename.Mtime" />
      </processorChain>
      <destinations>
        <destination server="ftp push cdn" path="static" />
      </destinations>
    </rule>

    <!--
    Add all files in the files/css directory, *but* update the URLs in the
    files. This is only necessary if we use CSS aggregation.
    -->
    <rule for="drupal" label="CSS aggregation">
      <filter>
        <paths>sites/default/files/css</paths>
        <ignoredDirs>CVS:.svn</ignoredDirs>
      </filter>
      <processorChain>
        <processor name="yui_compressor.YUICompressor" />
        <processor name="link_updater.CSSURLUpdater" />
        <processor name="unique_filename.Mtime" />
      </processorChain>
      <destinations>
        <destination server="ftp push cdn" path="static" />
      </destinations>
    </rule>

    <!--
    Add all files in the files/js directory. This is only necessary if we use
    JS aggregation.
    -->
    <rule for="drupal" label="JS aggregation">
      <filter>
        <paths>sites/default/files/js</paths>
        <ignoredDirs>CVS:.svn</ignoredDirs>
      </filter>
      <processorChain>
        <processor name="yui_compressor.YUICompressor" />
        <processor name="unique_filename.Mtime" />
      </processorChain>
      <destinations>
        <destination server="ftp push cdn" path="static" />
      </destinations>
    </rule>
  </rules>
</config>
