*
* @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 - 2011 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
/**
* The current path we are working in
*/
- private $pathName = "";
+ private $pathName = '';
/**
* The directory pointer
*/
- private $dirPointer = null;
+ private $dirPointer = NULL;
/**
* Protected constructor
protected function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
-
- // Clean-up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
* 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
- * not a string
+ * not a string
* @throws PathIsNoDirectoryException If the provided path name is
- * not valid
+ * not valid
* @throws PathReadProtectedException If the provided path name is
- * read-protected
+ * read-protected
* @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) {
+ public static final function createFrameworkDirectoryPointer ($pathName, $inConstructor = false) {
// Some pre-sanity checks...
if (is_null($pathName)) {
// No pathname given
* @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();
public function closeDirectory () {
// Close the directory pointer and reset the instance variable
@closedir($this->getPointer());
- $this->setPointer(null);
- $this->setPathName("");
+ $this->setPointer(NULL);
+ $this->setPathName('');
}
/**
$this->dirPointer = $dirPointer;
} else {
// Throw exception
- throw new InvalidDirectoryResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
+ throw new InvalidResourceException($this, self::EXCEPTION_INVALID_RESOURCE);
}
}