From db4c373aced628a602619c9cff98e21a8679cc5f Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Tue, 19 Sep 2017 20:40:43 +0200 Subject: [PATCH] fix: PHP4x + PHP5x constructors change for PHP7+ compatible ones --- GameEngine/Admin/database.php | 2 +- GameEngine/Automation.php | 2 +- GameEngine/Building.php | 2 +- GameEngine/Database.php | 2 +- GameEngine/Form.php | 2 +- GameEngine/Message.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GameEngine/Admin/database.php b/GameEngine/Admin/database.php index 6967bf0a..54e365bd 100755 --- a/GameEngine/Admin/database.php +++ b/GameEngine/Admin/database.php @@ -28,7 +28,7 @@ include_once("../GameEngine/Database.php"); class adm_DB { var $connection; - function adm_DB(){ + function __construct(){ global $database; $database = new MYSQLi_DB; $this->connection = $database->return_link(); diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index d0e52977..744a25e7 100755 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -165,7 +165,7 @@ class Automation { return $popT; } - public function Automation() { + public function __construct() { $this->procNewClimbers(); $this->ClearUser(); diff --git a/GameEngine/Building.php b/GameEngine/Building.php index 16ce3ae0..f7698cd5 100755 --- a/GameEngine/Building.php +++ b/GameEngine/Building.php @@ -25,7 +25,7 @@ class Building { private $basic,$inner,$plus = 0; public $buildArray = array(); - public function Building() { + public function __construct() { global $session; $this->maxConcurrent = BASIC_MAX; if(ALLOW_ALL_TRIBE || $session->tribe == 1) { diff --git a/GameEngine/Database.php b/GameEngine/Database.php index 4a56b477..bf0ed663 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -20,7 +20,7 @@ class MYSQLi_DB { var $dblink; - function mysqli_DB() { + function __construct() { $this->dblink = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysqli_error()); mysqli_select_db($this->dblink, SQL_DB); mysqli_query($this->dblink,"SET NAMES 'UTF8'"); diff --git a/GameEngine/Form.php b/GameEngine/Form.php index 69c22939..172f1157 100755 --- a/GameEngine/Form.php +++ b/GameEngine/Form.php @@ -15,7 +15,7 @@ class Form { public $valuearray = array(); private $errorcount; - public function Form() { + public function __construct() { if(isset($_SESSION['errorarray']) && isset($_SESSION['valuearray'])) { $this->errorarray = $_SESSION['errorarray']; $this->valuearray = $_SESSION['valuearray']; diff --git a/GameEngine/Message.php b/GameEngine/Message.php index edb98f5b..2d274cc4 100755 --- a/GameEngine/Message.php +++ b/GameEngine/Message.php @@ -17,7 +17,7 @@ class Message { private $totalMessage, $totalNotice; private $allNotice = array(); - function Message() { + function __construct() { $this->getMessages(); $this->getNotice(); if($this->totalMessage > 0) {