<?php
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+
/**
* Local configuration file, put this into your application/xyz/ folder and
* ignore config-local.php in .gitignore (see my apps for examples). This way
*/
// Get the configuration instance
-$cfg = FrameworkConfiguration::getSelfInstance();
+$cfg = FrameworkBootstrap::getConfigurationInstance();
// CFG: FOO-BAR
//$cfg->setConfigEntry('foo_bar', 12345);
* Read lines from the current directory pointer except some parts
*
* @param $except Some parts of a directory we want to ignore. Valid: directory and file names, other values will be silently ignored
- * @return string Directory and/or file names read from the current directory pointer
+ * @return SplFileInfo An instance of a SplFileInfo class
*/
public function readDirectoryExcept (array $except = array()) {
// No exceptions given?
}
// Init raw line
- $rawLine = NULL;
+ $fileInfoInstance = NULL;
// Read a raw line...
$currentEntry = $this->readRawDirectory();
// Shall we exclude directories?
if (is_object($currentEntry)) {
// Get file name
- $rawLine = $currentEntry->getFilename();
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawLine[' . gettype($rawLine) . ']=' . $rawLine . ',isDot=' . intval($this->getDirectoryIteratorInstance()->isDot()));
+ $fileInfoInstance = $currentEntry;
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: fileInfoInstance[' . gettype($fileInfoInstance) . ']=' . $fileInfoInstance . ',isDot=' . intval($this->getDirectoryIteratorInstance()->isDot()));
// Is it a dot-directory or excluded?
- if (($this->getDirectoryIteratorInstance()->isDot()) || (in_array($rawLine, $except))) {
+ if (($this->getDirectoryIteratorInstance()->isDot()) || (in_array($fileInfoInstance, $except))) {
// To next entry
$this->getDirectoryIteratorInstance()->next();
// Exclude this part
- $rawLine = $this->readDirectoryExcept($except);
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawline[' . gettype($rawLine) . ']=' . $rawLine . ' - Recursive call!');
+ $fileInfoInstance = $this->readDirectoryExcept($except);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: fileInfoInstance[' . gettype($fileInfoInstance) . ']=' . $fileInfoInstance . ' - Recursive call!');
} // END - if
} // END - if
$this->getDirectoryIteratorInstance()->next();
// Return read line
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawLine[' . gettype($rawLine) . ']=' . $rawLine);
- return $rawLine;
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: fileInfoInstance[' . gettype($fileInfoInstance) . ']=' . $fileInfoInstance);
+ return $fileInfoInstance;
}
/**