MediaWiki  1.23.6
bench_HTTP_HTTPS.php
Go to the documentation of this file.
1 <?php
27 require_once __DIR__ . '/Benchmarker.php';
28 
35 
36  public function __construct() {
37  parent::__construct();
38  $this->mDescription = "Benchmark HTTP request vs HTTPS request.";
39  }
40 
41  public function execute() {
42  $this->bench( array(
43  array( 'function' => array( $this, 'getHTTP' ) ),
44  array( 'function' => array( $this, 'getHTTPS' ) ),
45  ));
46  print $this->getFormattedResults();
47  }
48 
49  static function doRequest( $proto ) {
50  Http::get( "$proto://localhost/" );
51  }
52 
53  // bench function 1
54  function getHTTP() {
55  $this->doRequest( 'http' );
56  }
57 
58  // bench function 2
59  function getHTTPS() {
60  $this->doRequest( 'https' );
61  }
62 }
63 
64 $maintClass = 'bench_HTTP_HTTPS';
65 require_once RUN_MAINTENANCE_IF_MAIN;
bench_HTTP_HTTPS\getHTTP
getHTTP()
Definition: bench_HTTP_HTTPS.php:54
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
$maintClass
$maintClass
Definition: bench_HTTP_HTTPS.php:64
Benchmarker\getFormattedResults
getFormattedResults()
Definition: Benchmarker.php:78
bench_HTTP_HTTPS\getHTTPS
getHTTPS()
Definition: bench_HTTP_HTTPS.php:59
RUN_MAINTENANCE_IF_MAIN
require_once RUN_MAINTENANCE_IF_MAIN
Definition: maintenance.txt:50
bench_HTTP_HTTPS\doRequest
static doRequest( $proto)
Definition: bench_HTTP_HTTPS.php:49
Benchmarker\bench
bench(array $benchs)
Definition: Benchmarker.php:45
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
Http\get
static get( $url, $timeout='default', $options=array())
Simple wrapper for Http::request( 'GET' )
Definition: HttpFunctions.php:93
bench_HTTP_HTTPS\__construct
__construct()
Default constructor.
Definition: bench_HTTP_HTTPS.php:36
Benchmarker
Base class for benchmark scripts.
Definition: Benchmarker.php:37
bench_HTTP_HTTPS\execute
execute()
Do the actual work.
Definition: bench_HTTP_HTTPS.php:41
bench_HTTP_HTTPS
Maintenance script that benchmarks HTTP request vs HTTPS request.
Definition: bench_HTTP_HTTPS.php:34