public function parse($name, $args = array()) { if (trim($name) == '') { return false; } // set the language for this parse, and then load the language pack $this->lang = array_key_exists('lang', $args) ? $args['lang'] : WHP_LANG; $this->language->loadLanguage($this->lang); $cache = new wowhead_cache(); if (!($result = $cache->getFaction($name, $this->lang))) { $result = is_numeric($name) ? $this->getFactionByID($name) : $this->getFactionByName($name); if (!$result) { $cache->close(); return $this->_notFound($this->language->words['faction'], $name); } else { $cache->saveFaction($result); $cache->close(); return $this->generateHTML($result, 'faction'); } } else { $cache->close(); return $this->generateHTML($result, 'faction'); } }