function _open_src_file() { if ($this->_settings != null) { if (!is_string($this->_settings['src_file']) || !$this->_settings['src_file']) { $this->_errors = getMsg('DCONV', 'CANT_OPEN_FILE_01'); $this->_info['format'] = getMsg('ML', 'ML_INPORT_LABELS_UNKNOWN_FORMAT'); $this->_info['error'] = $this->_errors; $this->_src_file_handler = null; return; } if (!file_exists($this->_settings['src_file']) || !is_file($this->_settings['src_file'])) { $this->_errors = getMsg('DCONV', 'CANT_OPEN_FILE_02'); $this->_info['format'] = getMsg('ML', 'ML_INPORT_LABELS_UNKNOWN_FORMAT'); $this->_info['error'] = $this->_errors; $this->_src_file_handler = null; return; } if (!is_readable($this->_settings['src_file'])) { $this->_errors = getMsg('DCONV', 'CANT_OPEN_FILE_03'); $this->_info['format'] = getMsg('ML', 'ML_INPORT_LABELS_UNKNOWN_FORMAT'); $this->_info['error'] = $this->_errors; $this->_src_file_handler = null; return; } if (filesize($this->_settings['src_file']) == 0) { $this->_errors = getMsg('DCONV', 'CANT_OPEN_FILE_04'); $this->_info['format'] = getMsg('ML', 'ML_INPORT_LABELS_UNKNOWN_FORMAT'); $this->_info['error'] = $this->_errors; $this->_src_file_handler = null; return; } if (asc_detect_eol($this->_settings['src_file']) == "\r") { asc_mac2nix($this->_settings['src_file']); } $this->_src_file_handler = fopen($this->_settings['src_file'], 'r'); fseek($this->_src_file_handler, $this->_settings['file_position']); } else { $this->_errors = getMsg('DCONV', 'CANT_OPEN_FILE_01'); $this->_info['format'] = getMsg('ML', 'ML_INPORT_LABELS_UNKNOWN_FORMAT'); $this->_info['error'] = $this->_errors; $this->_src_file_handler = null; } }
function _open_src_file() { if ($this->_settings != null) { if (!is_string($this->_settings['src_file']) or $this->_settings['src_file'] == '') { $this->_errors = $this->MR->getMessage('CANT_OPEN_FILE_01'); //'can not open file. source not defined'; $this->_src_file_handler = null; return; } if (!file_exists($this->_settings['src_file']) or !is_file($this->_settings['src_file'])) { $this->_errors = $this->MR->getMessage('CANT_OPEN_FILE_02'); //'can not open file. source is not file'; $this->_src_file_handler = null; return; } if (!is_readable($this->_settings['src_file'])) { $this->_errors = $this->MR->getMessage('CANT_OPEN_FILE_03'); //'can not open file. source is not readable'; $this->_src_file_handler = null; return; } if (filesize($this->_settings['src_file']) == 0) { $this->_errors = $this->MR->getMessage('CANT_OPEN_FILE_04'); //'can not open file. source is empty'; $this->_src_file_handler = null; return; } if (asc_detect_eol($this->_settings['src_file']) == "\r") { asc_mac2nix($this->_settings['src_file']); } $this->_src_file_handler = fopen($this->_settings['src_file'], 'r'); fseek($this->_src_file_handler, $this->_settings['file_position']); } else { $this->_errors = $this->MR->getMessage('CANT_OPEN_FILE_01'); //'can not open file. source not defined'; $this->_src_file_handler = null; } }