_size = $size; } /** * Add a log entry. * * @param string $entry */ public function add($entry) { $this->_log[] = $entry; while (count($this->_log) > $this->_size) { array_shift($this->_log); } } /** * Clear the log contents. */ public function clear() { $this->_log = array(); } /** * Get this log as a string. * * @return string */ public function dump() { return implode(PHP_EOL, $this->_log); } }