/**
* Database backend class for storing objects in locally created files.
*
- * This class serializes objects and saves them to local files.
+ * This class serializes arrays stored in the dataset instance and saves them
+ * to local files. Every file (except 'info') represents a single line. Every
+ * directory within the 'db' (base) directory represents a table.
+ *
+ * A configurable 'file_io_class' is being used as "storage backend".
*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendInterface {
- // Constants for MySQL backward-compatiblity (PLEASE FIX THEM!)
- const DB_CODE_TABLE_MISSING = 0x100;
- const DB_CODE_TABLE_UNWRITEABLE = 0x101;
- const DB_CODE_DATA_FILE_CORRUPT = 0x102;
-
- // Status results
- const RESULT_OKAY = 'ok';
-
/**
* The file's extension
*/
// Initialize the result data, this need to be rewritten e.g. if a local file cannot be read
$resultData = array(
- BaseDatabaseBackend::RESULT_INDEX_STATUS => LocalfileDatabase::RESULT_OKAY,
+ BaseDatabaseBackend::RESULT_INDEX_STATUS => self::RESULT_OKAY,
BaseDatabaseBackend::RESULT_INDEX_ROWS => array()
);
// Does the extension match?
if (substr($dataFile, -(strlen($this->getFileExtension()))) !== $this->getFileExtension()) {
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',getFileExtension()=' . $this->getFileExtension() . ' - SKIPPED!');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',getFileExtension()=' . $this->getFileExtension() . ' - SKIPPED!');
// Skip this file!
continue;
} // END - if