コード例 #1
0
 public function ajax_speed()
 {
     $this->load->view('/player/speed', array('speeds' => getSpeed($this->db, 5)));
 }
コード例 #2
0
if (!file_exists("cache_" . $get . ".txt")) {
    file_put_contents("cache_" . $get . ".txt", "");
    $flag = false;
}
// Check if cache needs to be updated
if (filemtime("cache_" . $get . ".txt") + $cachetime > time() && $flag) {
    // Output the content of the cache
    echo file_get_contents("cache_" . $get . ".txt");
} else {
    // Save memInfo output to variable
    $time = time();
    if ($get == "NetSpeedUp") {
        $data["value"] = getSpeed("tx");
    } else {
        if ($get == "NetSpeedDown") {
            $data["value"] = getSpeed("rx");
        } else {
            if ($get == "NetExtIp") {
                $data["value"] = getExternalIP();
            } else {
                if ($get == "all") {
                    $memInfo = getMemInfo();
                    $i = 0;
                    foreach ($config["Software"] as $key => $value) {
                        $name = array_keys($value);
                        $name = $name[0];
                        $process = $value[$name];
                        $data[$key] = $name . " " . CheckRunningProcess($process);
                        $i++;
                    }
                    $data["HW_OS"] = getOperatingSystem();