function _rmdir($pid) { return _deleteDirectory($pid); }
function kfm_deleteDirectory($id, $recursive = 0) { include_once KFM_BASE_PATH . 'includes/directories.php'; return _deleteDirectory($id, $recursive); }
/** * deleteFile * * Delete a file. * * @param filePath File path string * @param rootDir Root directory * @param args HTTP QUERY-STRING arguments decoded. * @param status Receives the final result (200, 204 or 404). * * @return An array of FILE_INFO objects or NULL in case no match was found. **/ function deleteFile($filePath, $rootDir, $args, &$status) { if (file_exists($filePath)) { $status = HTTP_V_OK; $files = array(); $uri = parsePath($filePath, $rootDir); $fileInfo = fileToStruct($uri->dirPath, $rootDir, $uri->filename, $args); if (is_dir($filePath)) { $files = _deleteDirectory($filePath, $rootDir, $args, $stat); $result = rmdir($filePath); } else { chmod($filePath, 0666); $result = unlink($filePath); } if ($result) { $files[] = $fileInfo; } else { $status = HTTP_V_UNAUTHORIZED; } return $files; } $status = HTTP_V_NOT_FOUND; return null; }