Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions HTTP/DokuHTTPClient.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php


namespace dokuwiki\plugin\upgrade\HTTP;


use dokuwiki\Extension\Event;

/**
* Adds DokuWiki specific configs to the HTTP client
*
* @author Andreas Goetz <[email protected]>
*/
class DokuHTTPClient extends HTTPClient {

class DokuHTTPClient extends HTTPClient
{
/**
* Constructor.
*
* @author Andreas Gohr <[email protected]>
*/
public function __construct(){
public function __construct()
{
global $conf;

// call parent constructor
Expand All @@ -32,8 +32,8 @@ public function __construct(){
$this->proxy_except = $conf['proxy']['except'];

// allow enabling debugging via URL parameter (if debugging allowed)
if($conf['allowdebug']) {
if(
if ($conf['allowdebug']) {
if (
isset($_REQUEST['httpdebug']) ||
(
isset($_SERVER['HTTP_REFERER']) &&
Expand All @@ -58,20 +58,17 @@ public function __construct(){
* @param string $method
* @return bool
*/
public function sendRequest($url,$data='',$method='GET'){
$httpdata = array('url' => $url,
'data' => $data,
'method' => $method);
$evt = new \Doku_Event('HTTPCLIENT_REQUEST_SEND',$httpdata);
if($evt->advise_before()){
public function sendRequest($url, $data = '', $method = 'GET')
{
$httpdata = ['url' => $url, 'data' => $data, 'method' => $method];
$evt = new Event('HTTPCLIENT_REQUEST_SEND', $httpdata);
if ($evt->advise_before()) {
$url = $httpdata['url'];
$data = $httpdata['data'];
$method = $httpdata['method'];
}
$evt->advise_after();
unset($evt);
return parent::sendRequest($url,$data,$method);
return parent::sendRequest($url, $data, $method);
}

}

Loading