Skip to content

Instantly share code, notes, and snippets.

@enumag
Last active December 19, 2015 07:09
Show Gist options
  • Select an option

  • Save enumag/5916438 to your computer and use it in GitHub Desktop.

Select an option

Save enumag/5916438 to your computer and use it in GitHub Desktop.
Ivory Filter for Arachne Resources
<?php
namespace Media33;
class IvoryFilter extends \Nette\Object implements \Arachne\Resources\IFilter
{
/** @var \Ivory\Compiler */
protected $compiler;
/**
* @param \Ivory\Compiler $compiler
*/
public function __construct(\Ivory\Compiler $compiler)
{
$this->compiler = $compiler;
}
/**
* @param string
* @param string
* @return string
*/
public function __invoke($input, $file)
{
return $this->compiler->compileFile($file);
}
/**
* @return string[]
*/
public function getIncludedFiles()
{
return $this->compiler->getAllFiles();
}
}
services:
ivory.filter: Media33\IvoryFilter
ivory.compiler:
class: Ivory\Compiler
setup:
- setDefaultUnit(px)
arachne.resources:
inputDirectory: %wwwDir%/app/resources
cacheDirectory: %wwwDir%/cache
cacheUrl: /cache
cssFilters:
iss: @ivory.filter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment