diff options
author | Simon Rettberg | 2022-05-02 18:49:09 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-05-02 18:49:09 +0200 |
commit | 5eb8df7432a708284862e4b126e418265d36b4ab (patch) | |
tree | d8812cc2bd6245e0b02ca6866a4c14e977e1bb62 /inc/download.inc.php | |
parent | [rebootcontrol] Show time of execution for WOL/reboot/shutdown (diff) | |
download | slx-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.php | 6 |
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); |