Download vendor: Update HTTP download functions #25

Open
opened 2026-01-31 14:51:22 +01:00 by danb · 0 comments
Owner

Default to using CURL functions if curl is enabled, otherwise fallback to direct fopen.

CURL would generally be better to use, but it might not exist.
fopen is more available, but http/URL usage may be blocked by config.

Relevant lines:

$targetFile = @fopen($targetUrl, 'rb');
if ($targetFile === false) {
throw new CommandError("Failed to download ZIP file from $targetUrl");
}

Based on input from Ionys320: https://github.com/BookStackApp/BookStack/issues/5538#issuecomment-3819764070

Default to using CURL functions if curl is enabled, otherwise fallback to direct fopen. CURL would generally be better to use, but it might not exist. fopen is more available, but http/URL usage may be blocked by config. Relevant lines: https://codeberg.org/bookstack/system-cli/src/commit/24bbf72f6e760bf4ccc4c7ade8f0cbff029a1890/src/Services/VendorDownloader.php#L124-L127 Based on input from Ionys320: https://github.com/BookStackApp/BookStack/issues/5538#issuecomment-3819764070
Sign in to join this conversation.
No labels
Bug
Feature Addition
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bookstack/system-cli#25
No description provided.