Пример #1
0
 /**
  * {@inheritDoc}
  */
 public function interpret($rule)
 {
     if ($this->cache->contains($rule)) {
         return unserialize($this->cache->fetch($rule));
     }
     $ast = $this->interpreter->interpret($rule);
     $this->cache->save($rule, serialize($ast), $this->lifeTime);
     return $ast;
 }
Пример #2
0
 /**
  * Parses the rule into an equivalent AST.
  *
  * @param string $rule The rule represented as a string.
  *
  * @return \Hoa\Ruler\Model
  */
 private function interpret($rule)
 {
     return $this->interpreter->interpret($rule);
 }