The problem I'm having is a strange one, the log file says that the __construct method in my class called 'Upload' is private, BUT in reality it is Public! So the error makes no sense. This is my class code;
class Upload
{
public $Errors;
public $ImageTypes;
public $CDN_URL;
public $UploadPath;
private $MaxHeight;
private $MaxWidth;
private $MaxTokenLength;
private $ForceMaxDimensions;
private $MaxFileSize = 5;
public function __construct()
{
include_once 'config.php';
$this->ImageTypes = array('JPG', 'PNG');
$this->Errors = array();
# convert from megabytes to bytes
$this->MaxFileSize = $this->MaxFileSize * 1048576;
}
}
This is how I initiate the class;
include_once 'upload.php';
$Upload = new Upload;
This is the error from my log file;
PHP Fatal error: Call to private Upload::__construct() from invalid context
I've looked at many answers online and non have helped me, so I'm very much hoping for the answer from Stackoverflow! Thanks for any help.
EDIT: Contents of config.php file
$ImageTypes = array('JPG', 'PNG');
$CDN_URL = 'CDN.php';
$UploadPath = 'uploads/';
$MaxHeight = 1000;
$MaxWidth = 1000;
$ForceMaxDimensions = TRUE;
$MaxFileSize = 5;// Mb