From: Roland Häder Date: Sun, 1 Jun 2008 10:38:04 +0000 (+0000) Subject: Reading of database directory added X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=11ca3d829702e770073051f728151754190572e8;p=shipsimu.git Reading of database directory added --- diff --git a/inc/classes/exceptions/database/general/class_SqlException.php b/inc/classes/exceptions/database/general/class_SqlException.php index e39c1e2..542764a 100644 --- a/inc/classes/exceptions/database/general/class_SqlException.php +++ b/inc/classes/exceptions/database/general/class_SqlException.php @@ -31,7 +31,7 @@ class SqlException extends DatabaseException { */ public function __construct (array $msgArray, $code) { // Construct the message - $message = sprintf("[%s:%d] SQL error detected. Message from database: %s, code: 0x%s", + $message = sprintf("[%s:%d] SQL error detected. Message from database: %s, code: 0x%s.", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1], diff --git a/inc/classes/main/database/databases/class_LocalFileDatabase.php b/inc/classes/main/database/databases/class_LocalFileDatabase.php index 56034fa..6133051 100644 --- a/inc/classes/main/database/databases/class_LocalFileDatabase.php +++ b/inc/classes/main/database/databases/class_LocalFileDatabase.php @@ -565,8 +565,22 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend // find the "table" which is in fact a directory on the server try { // Get a directory pointer instance - $directoryPointer = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($pathName); - $this->partialStub("Finish handling found "tables""); + $directoryInstance = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($pathName); + + // Initialize the result data, this need to be rewritten e.g. if a local file cannot be read + $resultData = array( + 'status' => "ok", + 'rows' => array() + ); + + // Read the directory with some exceptions + while ($dataFile = $directoryInstance->readDirectoryExcept(array(".", "..", ".htaccess"))) { + $this->partialStub(sprintf("File %s found.", $dataFile)); + } // END - while + + // Close directory and throw the instance away + $directoryInstance->closeDirectory(); + unset($directoryInstance); // Reset last error message and exception $this->resetLastError();