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
]]>Done in 24bbf72f6e760bf4ccc4c7ade8f0cbff029a1890
]]>With this trailing space, execution on at least OpenBSD fails with a rather cryptic "env: php : not found" (note the trailing space)
]]>As referenced here: https://github.com/BookStackApp/BookStack/issues/5538#issuecomment-3567927500
Think it's tested enough for this process to be used in other parts of the CLI to be more efficient.
]]>Reported by B1t5murf on Discord, who confirmed issues with hashes, and that it's likely due to the lack of escaping at
$contents = "[client]\nuser={$this->user}\nhost={$this->host}\nport={$this->port}\npassword={$this->password}\nprotocol=TCP";
|
Closed via #21
]]>Closed via #21
]]>Closed via #21
]]>Closed via #21
]]>