From 47246891adb4cb2f30f1d568cbc814b0aa69295d Mon Sep 17 00:00:00 2001 From: Alex Rowe Date: Tue, 19 Jan 2021 11:03:24 +1100 Subject: [PATCH 1/2] Update pChart to have PHP7 style constructors --- lib/pChart/pCache.class | 2 +- lib/pChart/pChart.class | 2 +- lib/pChart/pData.class | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pChart/pCache.class b/lib/pChart/pCache.class index 2bcd6b04..3c3129eb 100644 --- a/lib/pChart/pCache.class +++ b/lib/pChart/pCache.class @@ -38,7 +38,7 @@ var $CacheFolder = "Cache/"; /* Create the pCache object */ - function pCache($CacheFolder="Cache/") + function __construct($CacheFolder="Cache/") { $this->CacheFolder = $CacheFolder; } diff --git a/lib/pChart/pChart.class b/lib/pChart/pChart.class index 10a4e267..147226c0 100644 --- a/lib/pChart/pChart.class +++ b/lib/pChart/pChart.class @@ -213,7 +213,7 @@ var $MapID = NULL; /* This function create the background picture */ - function pChart($XSize,$YSize) + function __construct($XSize,$YSize) { $this->XSize = $XSize; $this->YSize = $YSize; diff --git a/lib/pChart/pData.class b/lib/pChart/pData.class index a7ebc735..7061e850 100644 --- a/lib/pChart/pData.class +++ b/lib/pChart/pData.class @@ -50,7 +50,7 @@ var $Data; var $DataDescription; - function pData() + function __construct() { $this->Data = []; $this->DataDescription = []; From dd89a78f660282b907239ec1eeb445fe1c2f66e9 Mon Sep 17 00:00:00 2001 From: Alex Rowe Date: Tue, 19 Jan 2021 11:37:00 +1100 Subject: [PATCH 2/2] Update pChart to convert split to explode --- lib/pChart/pChart.class | 4 ++-- lib/pChart/pData.class | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pChart/pChart.class b/lib/pChart/pChart.class index 147226c0..6b59db99 100644 --- a/lib/pChart/pChart.class +++ b/lib/pChart/pChart.class @@ -298,7 +298,7 @@ $buffer = fgets($handle, 4096); $buffer = str_replace(chr(10),"",$buffer); $buffer = str_replace(chr(13),"",$buffer); - $Values = split($Delimiter,$buffer); + $Values = explode($Delimiter,$buffer); if ( count($Values) == 3 ) { $this->Palette[$ColorID]["R"] = $Values[0]; @@ -3384,7 +3384,7 @@ { /* Strip HTML query strings */ $Values = $this->tmpFolder.$MapName; - $Value = split("\?",$Values); + $Value = explode("?",$Values); $FileName = $Value[0]; if ( file_exists($FileName) ) diff --git a/lib/pChart/pData.class b/lib/pChart/pData.class index 7061e850..d737a607 100644 --- a/lib/pChart/pData.class +++ b/lib/pChart/pData.class @@ -72,7 +72,7 @@ $buffer = fgets($handle, 4096); $buffer = str_replace(chr(10),"",$buffer); $buffer = str_replace(chr(13),"",$buffer); - $Values = split($Delimiter,$buffer); + $Values = explode($Delimiter,$buffer); if ( $buffer != "" ) {