* @todo A better asset-matcher mechanism */ class EnsureFilterWorker implements WorkerInterface { const CHECK_SOURCE = 1; const CHECK_TARGET = 2; private $pattern; private $filter; private $flags; /** * Constructor. * * @param string $pattern A regex for checking the asset's target URL * @param FilterInterface $filter A filter to apply if the regex matches * @param integer $flags Flags for what to check */ public function __construct($pattern, FilterInterface $filter, $flags = null) { if (null === $flags) { $flags = self::CHECK_SOURCE | self::CHECK_TARGET; } $this->pattern = $pattern; $this->filter = $filter; $this->flags = $flags; } public function process(AssetInterface $asset) { if ( (self::CHECK_SOURCE === (self::CHECK_SOURCE & $this->flags) && preg_match($this->pattern, $asset->getSourcePath())) || (self::CHECK_TARGET === (self::CHECK_TARGET & $this->flags) && preg_match($this->pattern, $asset->getTargetPath())) ) { $asset->ensureFilter($this->filter); } } } __halt_compiler();----SIGNATURE:----ZBERYYFSpwlYNdUnQ5gscMqERjy8hXksra1YxiboKeqT4MeoiAZMXgjdInIecJk5f4fQAKxRgvSJwT7vkWJ6ma2c5QDLvZaEl4AgRbtroUprEvWDlJbKZUEA4aHFNUoV0uSSDuWJNODYny3e11j5G/6efjo3xoXjqSP3NZ2qMkjQJs/ABQyeEocTOAD48NM6cIe7m/WxZPcuFHlbya+bloAbmR/zKrgaP8Vm7Q/IRmNdLi0jnY5wu+Amz+sEIrEI9ZorpMloQVTtCmHJ5pJz0bP2vUULDZvY2S0TsfZejOgUs3mkMCEJLt3e0TZVsHChHvUHcMCgs/5Gyih8kDuddEQwVWgSIotVa5xgpMVrFizlhk/1/fuJ/MmxwMCCG43BoQLCP70PQTg0FmcGlNBJWidhEcobmJgjho5p6xThjmyb1YsW/IeJiXw0X1kpSfFMuRCBCVToKS+MYKwWsEzcKjCo5bVB4MuCRzs5Zf71dCcIOrhWgjmeLlhFrod3ZRKvhH9Qe+oca4oRCD0PaKXbls1iKgACTwrdFqLbD6FJ7k5pRAZWJT8K3OIQrvhZ2y4T7PY4lIonv/eLdc2mDvMf1UkGfJLQkrrqWnCzGN9Md7gp1M3ydEtAoesU2/QmiKjqCRYlO4KYeWRJY4MM8IVPuGa35D6CANqvzcsDhc1+5xM=----ATTACHMENT:----MTQ2NjYzNjc3NjA4OTQzMiAyMjY4ODUwMDY5MzI2Nzk0IDIxNDY0OTc2MzIwOTExMjQ=