Skip to content

Commit

Permalink
Merge branch 'svn'
Browse files Browse the repository at this point in the history
  • Loading branch information
wbond committed Aug 24, 2011
2 parents 1383b7c + dc333e7 commit 15b6730
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions classes/fDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
* @package Flourish
* @link http://flourishlib.com/fDirectory
*
* @version 1.0.0b13
* @version 1.0.0b14
* @changes 1.0.0b14 Fixed a bug in ::delete() where a non-existent method was being called on fFilesystem, added a permission check to ::delete() [wb, 2011-08-23]
* @changes 1.0.0b13 Added the ::clear() method [wb, 2011-01-10]
* @changes 1.0.0b12 Fixed ::scanRecursive() to not add duplicate entries for certain nested directory structures [wb, 2010-08-10]
* @changes 1.0.0b11 Fixed ::scan() to properly add trailing /s for directories [wb, 2010-03-16]
Expand Down Expand Up @@ -215,6 +216,13 @@ public function delete()
if ($this->deleted) {
return;
}

if (!$this->getParent()->isWritable()) {
throw new fEnvironmentException(
'The directory, %s, can not be deleted because the directory containing it is not writable',
$this->directory
);
}

$files = $this->scan();

Expand All @@ -224,7 +232,7 @@ public function delete()

// Allow filesystem transactions
if (fFilesystem::isInsideTransaction()) {
return fFilesystem::delete($this);
return fFilesystem::recordDelete($this);
}

rmdir($this->directory);
Expand Down

0 comments on commit 15b6730

Please sign in to comment.