Skip to content

Commit

Permalink
Modernize for MW 1.31 and PHP 7
Browse files Browse the repository at this point in the history
* Move to extension.json style
* Replace class constructors with __construct
* Replace addHeadItem with addModules
* Update parser hook callback
* Default to SSL database connection
  • Loading branch information
Josh Watts committed Nov 15, 2018
1 parent b49c097 commit 59e7e37
Show file tree
Hide file tree
Showing 9 changed files with 237 additions and 326 deletions.
6 changes: 3 additions & 3 deletions BMysqlConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BMysqlConnector {
protected $context;
protected $error;

function BMysqlConnector( $context ) {
function __construct( $context ) {
$this->setContext($context);
}

Expand All @@ -36,8 +36,8 @@ public function getContext() {
}

public function connect() {
$db = new mysqli($this->context->host,
$this->context->dbuser, $this->context->password);
$db = new mysqli();
$db->real_connect($this->context->host, $this->context->dbuser, $this->context->password, null, null, null, MYSQLI_CLIENT_SSL);

/*
* Set character encoding
Expand Down
2 changes: 1 addition & 1 deletion BugzillaQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class BugzillaQuery extends BSQLQuery {
# - warn,
# - getErrorMessage
#
function BugzillaQuery( $connector ) {
function __construct( $connector ) {
$this->setConnector($connector);
$this->setContext($connector->getContext());
}
Expand Down
2 changes: 1 addition & 1 deletion BugzillaQueryRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class BugzillaQueryRenderer {
var $connector;
var $output;

public function BugzillaQueryRenderer($query) {
public function __construct($query) {
$this->query=$query;
$this->context=$query->context;
$this->connector=$query->connector;
Expand Down
219 changes: 0 additions & 219 deletions BugzillaReport.php

This file was deleted.

Loading

0 comments on commit 59e7e37

Please sign in to comment.