public function deleteFile($path) { if (@file_exists($path)) { if (!@unlink($path)) { throw new Exception("Unable to delete {$path}: check permissions."); } } }