Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed constant available only in php 5.3 and changed exception type…

… to fix errors on php 5.2. Fixes #2487
  • Loading branch information...
commit 2c239cc8515d730ea4489fe8758f1de0c94cc33b 1 parent 5e495ad
@ADmad ADmad authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/Cake/Utility/Folder.php
View
8 lib/Cake/Utility/Folder.php
@@ -154,7 +154,7 @@ public function read($sort = true, $exceptions = false, $fullPath = false) {
try {
$iterator = new DirectoryIterator($this->path);
- } catch (UnexpectedValueException $e) {
+ } catch (Exception $e) {
return array($dirs, $files);
}
@@ -423,9 +423,9 @@ public function tree($path = null, $exceptions = true, $type = null) {
}
try {
- $directory = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_PATHNAME | RecursiveDirectoryIterator::CURRENT_AS_SELF | RecursiveDirectoryIterator::SKIP_DOTS);
+ $directory = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_PATHNAME | RecursiveDirectoryIterator::CURRENT_AS_SELF);
$iterator = new RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST);
- } catch (UnexpectedValueException $e) {
+ } catch (Exception $e) {
if ($type === null) {
return array(array(), array());
}
@@ -446,7 +446,7 @@ public function tree($path = null, $exceptions = true, $type = null) {
if ($item->isFile()) {
$files[] = $itemPath;
- } elseif ($item->isDir()) {
+ } elseif ($item->isDir() && !$item->isDot()) {
$directories[] = $itemPath;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.