function ShapeRecord(&$fp, $file_name) { $this->fp = $fp; _d("Shape record created at byte " . ftell($fp)); $this->_readHeader(); $function_name = "read" . $this->getRecordClass(); _d("Calling reading function [{$function_name}] starting at byte " . ftell($fp)); if (function_exists($function_name)) { $this->shp_data = $function_name($this->fp); } else { $this->setError(sprintf(INEXISTENT_FUNCTION, $function_name)); } $this->file_name = processDBFFileName($file_name); $this->dbf = new CY_Util_DBF(); $this->dbf->load_dbf($this->file_name); $this->_fetchDBFInformation(); }
function ShapeFile($file_name, $options) { $this->options = $options; $this->file_name = $file_name; //_d("Opening [$file_name]"); if (!is_readable($file_name)) { return $this->setError(sprintf(ERROR_FILE_NOT_FOUND, $file_name)); } $this->fp = fopen($this->file_name, "rb"); $this->_fetchShpBasicConfiguration(); //Set the dbf filename $this->dbf_filename = processDBFFileName($this->file_name); }