*/
function deleteFile($file)
{
- $this->_vfsInit();
-
- return $this->_vfs->deleteFile(TURBA_VFS_PATH . '/' . $this->getValue('__uid'), $file);
+ if (!is_a($result = $this->_vfsInit(), 'PEAR_Error')) {
+ return $this->_vfs->deleteFile(TURBA_VFS_PATH . '/' . $this->getValue('__uid'), $file);
+ } else {
+ return $result;
+ }
}
/**
*/
function deleteFiles()
{
- $this->_vfsInit();
+ if (!is_a($result = $this->_vfsInit(), 'PEAR_Error')) {
+ if ($this->_vfs->exists(TURBA_VFS_PATH, $this->getValue('__uid'))) {
+ return $this->_vfs->deleteFolder(TURBA_VFS_PATH, $this->getValue('__uid'), true);
+ }
- if ($this->_vfs->exists(TURBA_VFS_PATH, $this->getValue('__uid'))) {
- return $this->_vfs->deleteFolder(TURBA_VFS_PATH, $this->getValue('__uid'), true);
+ return true;
}
- return true;
+ return $result;
}
/**