https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40811

--- Comment #2 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 186858
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186858&action=edit
Bug 40811: Implement simplified Transport API with connection management

This commit introduces a simplified API for the Transport classes that reduces
the traditional 5-step workflow to a 2-step workflow while maintaining backward
compatibility.

Key changes:
- Centralized connection and directory management in base Transport class
- Added _ensure_connected() method for automatic connection handling
- Added _auto_change_directory() for intelligent directory management
- Refactored all transport methods to use private implementations
(_upload_file, etc.)
- Added state tracking to respect explicit change_directory() calls
- Support for both traditional explicit API and simplified auto-managing API

Traditional API (unchanged):
  $transport->connect();
  $transport->change_directory($path);
  $transport->upload_file($local, $remote);
  $transport->disconnect();

Simplified API (new):
  $transport->upload_file($local, $remote, { path => '/custom/path' });
  # OR using default upload directory:
  $transport->upload_file($local, $remote);

The implementation intelligently handles three scenarios:
1. Simplified API with custom path - uses provided path
2. Traditional API with explicit directory management - respects user's choice
3. Traditional API without explicit directories - uses configured defaults

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to