|
Last change
on this file since 7632 was 7631, checked in by Pieter Naber, 16 years ago |
|
Fixed a lot of bugs, introduced KMLFile::parseFile for parsing the node status file
|
|
File size:
667 bytes
|
| Line | |
|---|
| 1 | <?
|
|---|
| 2 | /*
|
|---|
| 3 | * Project: NodeMap2.0
|
|---|
| 4 | * File: FileHandler.class.php
|
|---|
| 5 | * Purpose: Checking and reading node files from the server
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | class FileHandler {
|
|---|
| 9 | private $file;
|
|---|
| 10 |
|
|---|
| 11 | /*
|
|---|
| 12 | * Function: __construct (constructor)
|
|---|
| 13 | * Parameters: string $filename
|
|---|
| 14 | * Function: Handling with a node file
|
|---|
| 15 | */
|
|---|
| 16 | public function __construct($filename) {
|
|---|
| 17 | try {
|
|---|
| 18 | $handle = fopen($filename, 'r');
|
|---|
| 19 | $this->file = '';
|
|---|
| 20 | while (!feof($handle)) {
|
|---|
| 21 | $this->file .= fread($handle, 8192);
|
|---|
| 22 | }
|
|---|
| 23 | fclose($handle);
|
|---|
| 24 | } catch (Exception $err) {
|
|---|
| 25 | // TODO: Better error description
|
|---|
| 26 | trigger_error();
|
|---|
| 27 | }
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | public function getFile() {
|
|---|
| 31 | return $this->file;
|
|---|
| 32 | }
|
|---|
| 33 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.