예제 #1
0
 /**
  * Send a bugreport.
  */
 public function bugreport()
 {
     $params = new ParamStruct();
     $params->add_required_param('bugreport', PDT_STRING);
     $params->fill();
     if (!$params->is_valid()) {
         AjaxModul::return_code(AjaxModul::ERROR_INVALID_PARAMETER);
     }
     if (!file_exists($params->bugreport)) {
         AjaxModul::return_code(AjaxModul::ERROR_INVALID_PARAMETER, null, true, 'Bugreport file not found');
     }
     $http = new HttpClient();
     $http->do_post('https://www.phpminer.com/bugreport.php', array('bugreport' => base64_encode(file_get_contents($params->bugreport))), true);
     AjaxModul::return_code(AjaxModul::SUCCESS);
 }
예제 #2
0
                }
            } catch (Exception $e) {
            }
            try {
                // Send Push.co notification if enabled.
                if ($pushco_enabled) {
                    $pushco_http = new HttpClient();
                    $pushco_http->do_post('https://api.push.co/1.0/push', array('api_key' => $pushco_api_key, 'api_secret' => $pushco_api_secret, 'notification_type' => $type, 'message' => $data), true);
                }
            } catch (Exception $e) {
            }
            try {
                // Send custom post notification if enabled.
                if ($post_enabled) {
                    $http = new HttpClient();
                    $http->do_post($post_url, array('type' => $type, 'msg' => $data));
                }
            } catch (Exception $e) {
            }
        }
    }
    // Loop through each rig which needs to be rebooted.
    foreach ($rigs_to_reboot as $rig => $need_reboot) {
        if (empty($need_reboot)) {
            continue;
        }
        $rig_cfg = $config->get_rig($rig);
        $rpc = new PHPMinerRPC($rig_cfg['http_ip'], $rig_cfg['http_port'], $rig_cfg['rpc_key'], 10);
        $rpc->reboot();
    }
}