Registry rewritten, exception added #2
[core.git] / inc / classes / main / io / class_FrameworkDirectoryPointer.php
index ccbb545e276c32227c1c2a4925728cf8257bbad2..9b07e1271750f775b6d16ee4926879261ffd29b8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -25,7 +25,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
        /**
         * The current path we are working in
         */
        /**
         * The current path we are working in
         */
-       private $pathName = "";
+       private $pathName = '';
 
        /**
         * The directory pointer
 
        /**
         * The directory pointer
@@ -38,10 +38,6 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
-
-               // Clean-up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
        }
 
        /**
@@ -62,22 +58,21 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
         * Create a directory pointer based on the given path. The path will also
         * be verified here.
         *
         * Create a directory pointer based on the given path. The path will also
         * be verified here.
         *
-        * @param               $pathName                                       The path name we shall pass
-        *                                                                      to opendir()
-        * @param               $inConstructor                          If we are in de/con-structor
-        *                                                                      or from somewhere else
-        * @throws      PathIsEmptyException            If the provided path name
+        * @param       $pathName               The path name we shall pass to opendir()
+        * @param       $inConstructor  If we are in de/con-structor or from somewhere
+        *                                                      else
+        * @return      $pointerInstance        A prepared instance of
+        *                                                              FrameworkDirectoryPointer
+        * @throws      PathIsEmptyException    If the provided path name
         *                                                                      is empty
         * @throws      InvalidPathStringException      If the provided path name is
         *                                                                      is empty
         * @throws      InvalidPathStringException      If the provided path name is
-        *                                                                      not a string
+        *                                                                              not a string
         * @throws      PathIsNoDirectoryException      If the provided path name is
         * @throws      PathIsNoDirectoryException      If the provided path name is
-        *                                                                      not valid
+        *                                                                              not valid
         * @throws      PathReadProtectedException      If the provided path name is
         * @throws      PathReadProtectedException      If the provided path name is
-        *                                                                      read-protected
+        *                                                                              read-protected
         * @throws      DirPointerNotOpened                     If opendir() returns not a
         * @throws      DirPointerNotOpened                     If opendir() returns not a
-        *                                                                      directory resource
-        * @return      $pointerInstance                        A prepared instance of
-        *                                                                      FrameworkDirectoryPointer
+        *                                                                              directory resource
         */
        public final static function createFrameworkDirectoryPointer ($pathName, $inConstructor = false) {
                // Some pre-sanity checks...
         */
        public final static function createFrameworkDirectoryPointer ($pathName, $inConstructor = false) {
                // Some pre-sanity checks...
@@ -153,7 +148,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
         * @return      string  Directory and/or file names read from the current
         *                                      directory pointer
         */
         * @return      string  Directory and/or file names read from the current
         *                                      directory pointer
         */
-       public function readDirectoryExcept ($except = "") {
+       public function readDirectoryExcept ($except = '') {
                if ((empty($except)) || (!is_array($except)) || (count($except) == 0)) {
                        // No exception given, so read all data
                        return $this->readRawDirectory();
                if ((empty($except)) || (!is_array($except)) || (count($except) == 0)) {
                        // No exception given, so read all data
                        return $this->readRawDirectory();
@@ -185,7 +180,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
                // Close the directory pointer and reset the instance variable
                @closedir($this->getPointer());
                $this->setPointer(null);
                // Close the directory pointer and reset the instance variable
                @closedir($this->getPointer());
                $this->setPointer(null);
-               $this->setPathName("");
+               $this->setPathName('');
        }
 
        /**
        }
 
        /**
@@ -201,7 +196,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
                        $this->dirPointer = $dirPointer;
                } else {
                        // Throw exception
                        $this->dirPointer = $dirPointer;
                } else {
                        // Throw exception
-                       throw new InvalidDirectoryResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
+                       throw new InvalidResourceException($this, self::EXCEPTION_INVALID_RESOURCE);
                }
        }
 
                }
        }