]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/database/backend/class_CachedLocalFileDatabase.php
Introduced FileNotFoundException
[core.git] / inc / classes / main / database / backend / class_CachedLocalFileDatabase.php
index 7e486b1f38cf3959d4fe788718d737129b5d23b0..935cf27fe1a53ea87c033e8bd3ec4a9f67508bfe 100644 (file)
@@ -228,7 +228,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                // Get the file contents
                try {
                        $infoArray = $this->getDataArrayFromFile($fqfn);
-               } catch (FileIoException $e) {
+               } catch (FileNotFoundException $e) {
                        // Not found, so ignore it here
                }
 
@@ -279,9 +279,6 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         * @return      void
         */
        private function updateTableInfoFile (StoreableCriteria $dataSetInstance) {
-               // "Cache" table name
-               $tableName = $dataSetInstance->getTableName();
-
                // Create FQFN for creating the table information file
                $fqfn = $this->generateFqfnFromDataSet($dataSetInstance, 'info');
 
@@ -290,7 +287,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                $this->tableInfo[$tableName]['last_updated'] = time();
 
                // Write the data to the file
-               $this->writeDataArrayToFqfn($fqfn, $this->tableInfo[$tableName]);
+               $this->writeDataArrayToFqfn($fqfn, $this->tableInfo[$dataSetInstance->getTableName()]);
        }
 
        /**
@@ -583,7 +580,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                        $this->setLastException($e);
 
                        // Throw an SQL exception
-                       throw new SqlException(array($this, sprintf('Cannot write data to table '%s', is the table created?', $dataSetInstance->getTableName()), self::DB_CODE_TABLE_UNWRITEABLE), self::EXCEPTION_SQL_QUERY);
+                       throw new SqlException(array($this, sprintf('Cannot write data to table '%s', is the table created? Exception: %s, message:%s', $dataSetInstance->getTableName(), $e->__toString(), $e->getMessage()), self::DB_CODE_TABLE_UNWRITEABLE), self::EXCEPTION_SQL_QUERY);
                }
        }