formatted
This commit is contained in:
parent
545ee6bc25
commit
f369af1358
@ -3,7 +3,6 @@
|
||||
namespace ManiaControl\Files;
|
||||
|
||||
use cURL\Event;
|
||||
use cURL\Exception;
|
||||
use cURL\Request;
|
||||
use ManiaControl\ManiaControl;
|
||||
|
||||
@ -36,6 +35,18 @@ class AsynchronousFileReader {
|
||||
$this->maniaControl = $maniaControl;
|
||||
}
|
||||
|
||||
public static function newRequestTest($url) {
|
||||
$request = new Request($url);
|
||||
$request->getOptions()
|
||||
->set(CURLOPT_TIMEOUT, 60)
|
||||
->set(CURLOPT_HEADER, false) // don't display response header
|
||||
->set(CURLOPT_CRLF, true) // linux line feed
|
||||
->set(CURLOPT_ENCODING, '') // accept encoding
|
||||
->set(CURLOPT_USERAGENT, 'ManiaControl v' . ManiaControl::VERSION) // user-agent
|
||||
->set(CURLOPT_RETURNTRANSFER, true); // return instead of output content
|
||||
return $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append available Data of active Requests
|
||||
*/
|
||||
@ -103,6 +114,8 @@ class AsynchronousFileReader {
|
||||
return $request;
|
||||
}
|
||||
|
||||
//TODO remove, they are just for testing dedimania
|
||||
|
||||
/**
|
||||
* Add a Request to the queue
|
||||
*
|
||||
@ -112,19 +125,6 @@ class AsynchronousFileReader {
|
||||
array_push($this->requests, $request);
|
||||
}
|
||||
|
||||
//TODO remove, they are just for testing dedimania
|
||||
public static function newRequestTest($url){
|
||||
$request = new Request($url);
|
||||
$request->getOptions()
|
||||
->set(CURLOPT_TIMEOUT, 60)
|
||||
->set(CURLOPT_HEADER, false) // don't display response header
|
||||
->set(CURLOPT_CRLF, true) // linux line feed
|
||||
->set(CURLOPT_ENCODING, '') // accept encoding
|
||||
->set(CURLOPT_USERAGENT, 'ManiaControl v' . ManiaControl::VERSION) // user-agent
|
||||
->set(CURLOPT_RETURNTRANSFER, true); // return instead of output content
|
||||
return $request;
|
||||
}
|
||||
|
||||
public function postDataTest(Request $request, $url, callable $function, $content, $compression = false,
|
||||
$contentType = 'text/xml; charset=UTF-8;') {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user