Syntax tidy up

Removed commented code, simplify parens & tabbed formatting
This commit is contained in:
Matt Pass
2012-11-28 17:04:01 +00:00
parent 4130df7bf9
commit d40cdeb65e
2 changed files with 12 additions and 15 deletions

View File

@@ -32,21 +32,18 @@ class SortingIterator implements IteratorAggregate {
}
class IgnorantRecursiveDirectoryIterator extends RecursiveDirectoryIterator {
function getChildren() {
try {
// echo "<pre>".var_export( $this->key(), true )."</pre>";
// echo "<pre>".var_export( $this->getSubPath(), true )."</pre>";
// echo "<pre>".var_export( $this->getSubPathname(), true )."</pre>";
if ( (!isset($GLOBALS['ICEcoder']['bannedPaths'])) ||
(! (in_array( $this->key(), $GLOBALS['ICEcoder']['bannedPaths'] ))) ) {
return parent::getChildren();
} else {
return new RecursiveArrayIterator(array());
function getChildren() {
try {
if (!isset($GLOBALS['ICEcoder']['bannedPaths']) ||
!in_array($this->key(), $GLOBALS['ICEcoder']['bannedPaths'])) {
return parent::getChildren();
} else {
return new RecursiveArrayIterator(array());
}
} catch(UnexpectedValueException $e) {
return new RecursiveArrayIterator(array());
}
}
} catch(UnexpectedValueException $e) {
return new RecursiveArrayIterator(array());
}
}
}
// Get a full list of dirs & files and begin sorting using above class & function

View File

@@ -24,4 +24,4 @@ $ICEcoder = array(
"previousFiles" => "",
"last10Files" => ""
);
?>
?>