1
1
<?php
2
2
3
-
4
3
namespace dokuwiki \plugin \upgrade \HTTP ;
5
4
6
-
5
+ use dokuwiki \ Extension \ Event ;
7
6
8
7
/**
9
8
* Adds DokuWiki specific configs to the HTTP client
10
9
*
11
10
* @author Andreas Goetz <cpuidle@gmx.de>
12
11
*/
13
- class DokuHTTPClient extends HTTPClient {
14
-
12
+ class DokuHTTPClient extends HTTPClient
13
+ {
15
14
/**
16
15
* Constructor.
17
16
*
18
17
* @author Andreas Gohr <andi@splitbrain.org>
19
18
*/
20
- public function __construct (){
19
+ public function __construct ()
20
+ {
21
21
global $ conf ;
22
22
23
23
// call parent constructor
@@ -32,8 +32,8 @@ public function __construct(){
32
32
$ this ->proxy_except = $ conf ['proxy ' ]['except ' ];
33
33
34
34
// allow enabling debugging via URL parameter (if debugging allowed)
35
- if ($ conf ['allowdebug ' ]) {
36
- if (
35
+ if ($ conf ['allowdebug ' ]) {
36
+ if (
37
37
isset ($ _REQUEST ['httpdebug ' ]) ||
38
38
(
39
39
isset ($ _SERVER ['HTTP_REFERER ' ]) &&
@@ -58,20 +58,17 @@ public function __construct(){
58
58
* @param string $method
59
59
* @return bool
60
60
*/
61
- public function sendRequest ($ url ,$ data ='' ,$ method ='GET ' ){
62
- $ httpdata = array ('url ' => $ url ,
63
- 'data ' => $ data ,
64
- 'method ' => $ method );
65
- $ evt = new \Doku_Event ('HTTPCLIENT_REQUEST_SEND ' ,$ httpdata );
66
- if ($ evt ->advise_before ()){
61
+ public function sendRequest ($ url , $ data = '' , $ method = 'GET ' )
62
+ {
63
+ $ httpdata = ['url ' => $ url , 'data ' => $ data , 'method ' => $ method ];
64
+ $ evt = new Event ('HTTPCLIENT_REQUEST_SEND ' , $ httpdata );
65
+ if ($ evt ->advise_before ()) {
67
66
$ url = $ httpdata ['url ' ];
68
67
$ data = $ httpdata ['data ' ];
69
68
$ method = $ httpdata ['method ' ];
70
69
}
71
70
$ evt ->advise_after ();
72
71
unset($ evt );
73
- return parent ::sendRequest ($ url ,$ data ,$ method );
72
+ return parent ::sendRequest ($ url , $ data , $ method );
74
73
}
75
-
76
74
}
77
-
0 commit comments