|
Text to go in the release notes:
|
This enhancement introduces a modernized dual API design for Koha's file transport system, making it easier for developers to work with FTP, SFTP, and local file operations.
Key Improvements
Simplified API (Recommended)
- Automatic connection management - no need for manual connect() / disconnect() calls
- Per-operation directory control via options hashref
- Stateless operations safe for concurrent usage
# Simple one-line operations
$transport->upload_file($local, $remote, { path => '/custom/' });
$transport->download_file($remote, $local);
$transport->list_files({ path => '/incoming/' });
Traditional API (Still Supported)
- Manual connection and directory management when needed
- Ideal for multiple operations in the same directory
- Full backward compatibility maintained
# Explicit control when needed
$transport->change_directory('/work/');
$transport->upload_file($local, 'file1.txt');
$transport->upload_file($local, 'file2.txt');
Standardized Architecture
- Consistent template method pattern across all transport types (SFTP, FTP, Local)
- Clear separation between public API and protocol-specific implementation
- Improved authentication handling with fixes for password-less connections
This is an internal API enhancement that improves code maintainability and developer experience without affecting end-user functionality.
|