11<?php
22
3-
43namespace dokuwiki \plugin \upgrade \HTTP ;
54
6-
5+ use dokuwiki \ Extension \ Event ;
76
87/**
98 * Adds DokuWiki specific configs to the HTTP client
109 *
1110 * @author Andreas Goetz <cpuidle@gmx.de>
1211 */
13- class DokuHTTPClient extends HTTPClient {
14-
12+ class DokuHTTPClient extends HTTPClient
13+ {
1514 /**
1615 * Constructor.
1716 *
1817 * @author Andreas Gohr <andi@splitbrain.org>
1918 */
20- public function __construct (){
19+ public function __construct ()
20+ {
2121 global $ conf ;
2222
2323 // call parent constructor
@@ -32,8 +32,8 @@ public function __construct(){
3232 $ this ->proxy_except = $ conf ['proxy ' ]['except ' ];
3333
3434 // allow enabling debugging via URL parameter (if debugging allowed)
35- if ($ conf ['allowdebug ' ]) {
36- if (
35+ if ($ conf ['allowdebug ' ]) {
36+ if (
3737 isset ($ _REQUEST ['httpdebug ' ]) ||
3838 (
3939 isset ($ _SERVER ['HTTP_REFERER ' ]) &&
@@ -58,20 +58,17 @@ public function __construct(){
5858 * @param string $method
5959 * @return bool
6060 */
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 ()) {
6766 $ url = $ httpdata ['url ' ];
6867 $ data = $ httpdata ['data ' ];
6968 $ method = $ httpdata ['method ' ];
7069 }
7170 $ evt ->advise_after ();
7271 unset($ evt );
73- return parent ::sendRequest ($ url ,$ data ,$ method );
72+ return parent ::sendRequest ($ url , $ data , $ method );
7473 }
75-
7674}
77-
0 commit comments