function compile($assets)
{
$env = $this->environment;
if (!is_dir($this->directory)) {
mkdir($this->directory, 0700, true);
}
$assets = array_filter(array_map(function ($path) use($env) {
return $env->find($path, array('bundled' => true));
}, (array) $assets));
foreach ($assets as $asset) {
$this->getLogger()->info("Compiling \"{$asset->getLogicalPath()}\"");
$start = microtime(true);
$this->files->{$asset->getDigestName()} = array('logical_path' => $asset->getLogicalPath(), 'mtime' => date(DATE_ISO8601, $asset->getLastModified()), 'size' => strlen($asset->getBody()), 'digest' => $asset->getDigest(), 'content_type' => $asset->getContentType());
$this->assets->{$asset->getLogicalPath()} = $asset->getDigestName();
$asset->write(array('dir' => $this->directory, 'compress' => false, 'include_digest' => true));
if ($this->compress) {
$asset->write(array("dir" => $this->directory, "compress" => true, "include_digest" => true));
}
$this->getLogger()->info(sprintf('Finished compiling "%s" in %f seconds', $asset->getLogicalPath(), microtime(true) - $start));
$this->save();
}
}