Example #1
0
 function get_first_folder()
 {
     parent::get();
     if (isset($this->folders[0])) {
         return $this->folders[0];
     } else {
         return null;
     }
 }
Example #2
0
 function get_lines($start = 0, $n = -1)
 {
     if ($this->mode & READ) {
         parent::get();
         if (!$start && $n == -1) {
             return $this->lines;
         } else {
             if ($n == -1) {
                 return array_slice($this->lines, $start);
             } else {
                 return array_slice($this->lines, $start, $n);
             }
         }
     } else {
         user_error('File ' . $this->path . ' is open in the write only mode, it can\'t be read');
     }
 }