18 public function __construct($path) {
19 $this->fd
= fopen($path, "rb");
23 * Read the title of the refentry
26 public function readTitle() {
27 if (0 === fseek($this->fd
, 1, SEEK_SET
)) {
28 return fgets($this->fd
);
33 * Read the description of the refentry
36 public function readDescription() {
37 if (0 === fseek($this->fd
, 0, SEEK_SET
)
38 && (false !== fgets($this->fd
))
39 && (false !== fgets($this->fd
))) {
40 return fgets($this->fd
);
45 * Read the first subsection of a global refentry
48 public function readIntro() {
50 if (0 === fseek($this->fd
, 0, SEEK_SET
)) {
53 while (!feof($this->fd
)) {
54 if (false === ($line = fgets($this->fd
))) {
57 /* search first header and read until next header*/
58 if ("## " === substr($line, 0, 3)) {