summaryrefslogtreecommitdiffstats
path: root/inc/download.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2022-05-02 18:49:09 +0200
committerSimon Rettberg2022-05-02 18:49:09 +0200
commit5eb8df7432a708284862e4b126e418265d36b4ab (patch)
treed8812cc2bd6245e0b02ca6866a4c14e977e1bb62 /inc/download.inc.php
parent[rebootcontrol] Show time of execution for WOL/reboot/shutdown (diff)
downloadslx-admin-5eb8df7432a708284862e4b126e418265d36b4ab.tar.gz
slx-admin-5eb8df7432a708284862e4b126e418265d36b4ab.tar.xz
slx-admin-5eb8df7432a708284862e4b126e418265d36b4ab.zip
[inc/Util] Add types, move error printing functions to their own class
Diffstat (limited to 'inc/download.inc.php')
-rw-r--r--inc/download.inc.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/inc/download.inc.php b/inc/download.inc.php
index 39f8e2e2..5a71014e 100644
--- a/inc/download.inc.php
+++ b/inc/download.inc.php
@@ -14,7 +14,7 @@ class Download
if (self::$curlHandle === false) {
self::$curlHandle = curl_init();
if (self::$curlHandle === false) {
- Util::traceError('Could not initialize cURL');
+ ErrorHandler::traceError('Could not initialize cURL');
}
curl_setopt(self::$curlHandle, CURLOPT_CONNECTTIMEOUT, ceil($timeout / 2));
curl_setopt(self::$curlHandle, CURLOPT_TIMEOUT, $timeout);
@@ -30,7 +30,7 @@ class Download
$head = fopen($tmpfile, 'w+b');
unlink($tmpfile);
if ($head === false)
- Util::traceError("Could not open temporary head file $tmpfile for writing.");
+ ErrorHandler::traceError("Could not open temporary head file $tmpfile for writing.");
curl_setopt(self::$curlHandle, CURLOPT_WRITEHEADER, $head);
return self::$curlHandle;
}
@@ -111,7 +111,7 @@ class Download
{
$fh = fopen($target, 'wb');
if ($fh === false)
- Util::traceError("Could not open $target for writing.");
+ ErrorHandler::traceError("Could not open $target for writing.");
$ch = self::initCurl($url, $timeout, $head);
curl_setopt($ch, CURLOPT_FILE, $fh);
$res = curl_exec($ch);