Reading of database directory added
authorRoland Häder <roland@mxchange.org>
Sun, 1 Jun 2008 10:38:04 +0000 (10:38 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 1 Jun 2008 10:38:04 +0000 (10:38 +0000)
inc/classes/exceptions/database/general/class_SqlException.php
inc/classes/main/database/databases/class_LocalFileDatabase.php

index e39c1e25e84500a390a870572d36aa1cb8ec6fb6..542764aad8717dba9dcb63477a7898efe15ce6ef 100644 (file)
@@ -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: <u>%s</u>, code: <u>0x%s</u>",
+               $message = sprintf("[%s:%d] SQL error detected. Message from database: <u>%s</u>, code: <u>0x%s</u>.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1],
index 56034fa0b62087794511527ca856538c8286b05a..6133051540b7315978525a79864b22b1eee78524 100644 (file)
@@ -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 &quot;tables&quot;");
+                       $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();