Added better description, as the mind map in 'contrib/mindmaps/' suggest, a new
[core.git] / inc / classes / main / database / databases / class_LocalFileDatabase.php
index 375ec98ece9a00742edf85e71ba7e241d9d027d2..efe6951b3f63fea0e9c0ba283ed77defd7416da3 100644 (file)
@@ -2,7 +2,11 @@
 /**
  * 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
         */
@@ -331,7 +327,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
 
                        // 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()
                        );
 
@@ -475,7 +471,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
                                // 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