HEX
Server: LiteSpeed
System: Linux s12873.lon1.stableserver.net 5.14.0-611.11.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 3 09:47:37 EST 2025 x86_64
User: jairicem (1242)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /home/jairicem/bunkerltd.com/app/helpers/update_helper.php
<?php

defined('BASEPATH') or exit('No direct script access allowed');

if (!function_exists('get_remote_contents')) {
    function get_remote_contents($url, $post_fields = null)
    {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        if ($post_fields) {
            curl_setopt($curl, CURLOPT_POST, 1);
            curl_setopt($curl, CURLOPT_POSTFIELDS, $post_fields);
        }
        $resp = curl_exec($curl);
        if ($resp) {
            $result = $resp;
        } else {
            $result = json_encode(['status' => 'Failed', 'message' => 'Curl Error: "' . curl_error($curl) . '"']);
        }
        curl_close($curl);
        return $result;
    }
}

if (!function_exists('save_remote_file')) {
    function save_remote_file($file)
    {
        $protocol = is_https() ? 'https://' : 'http://';
        file_put_contents('./files/updates/' . $file, fopen($protocol . 'api.tecdiary.com/v1/download/file/' . $file, 'r'));
        return true;
    }
}