* Uses asynchronous I/O, allowing purges to be done in a highly parallel
* manner.
*
- * Could be replaced by curl_multi_exec() or some such.
+ * @todo Consider using MultiHttpClient.
*/
class SquidPurgeClient {
/** @var string */
public function __construct( $server, $options = [] ) {
$parts = explode( ':', $server, 2 );
$this->host = $parts[0];
- $this->port = isset( $parts[1] ) ? $parts[1] : 80;
+ $this->port = $parts[1] ?? 80;
}
/**
$request[] = "PURGE $path HTTP/1.1";
$request[] = "Host: $host";
} else {
+ wfDeprecated( '$wgSquidPurgeUseHostHeader = false', '1.33' );
$request[] = "PURGE $url HTTP/1.0";
}
$request[] = "Connection: Keep-Alive";
}
if ( $this->readState == 'status' ) {
$this->processStatusLine( $lines[0] );
- } else { // header
+ } else {
$this->processHeaderLine( $lines[0] );
}
$this->readBuffer = $lines[1];