public function getLogs($identifier, $category) { $identifier = Parser::slugifyIdentifier($identifier); $filename = sprintf("%s%s%s.log", $this->logsPath, $this->logsPrefix, $identifier); if (file_exists($filename)) { $logs = json_decode(file_get_contents($filename), true); } else { $logs = array(); } $logs = isset($logs[$identifier]) ? $logs[$identifier] : array(); return Parser::get($logs, $category); }
/** * @param $identifier * * @return array */ public function getLogs($identifier, $category) { $this->collection = $this->client->selectCollection($this->db, Parser::slugifyIdentifier($identifier)); $logs = iterator_to_array($this->collection->find()); return Parser::get($logs, $category); }