/** * Generate an rule string array * * @param int $level * @param string $eol * @return string */ private function generate($level, $eol) { $handler = new RenderHandler($level, $eol); if ($level === 3) { $this->root->userAgent()->render($handler); } $this->root->host()->render($handler); $this->root->cleanParam()->render($handler); $this->root->sitemap()->render($handler); if ($level !== 3) { $this->root->userAgent()->render($handler); } return $handler->generate(); }
/** * Rule array * * @return array */ public function export() { return [self::DIRECTIVE_HOST => $this->handler->host()->client()->export(), self::DIRECTIVE_CLEAN_PARAM => $this->handler->cleanParam()->client()->export(), self::DIRECTIVE_SITEMAP => $this->handler->sitemap()->client()->export(), self::DIRECTIVE_USER_AGENT => $this->handler->userAgent()->export()]; }