vidmarc Posted September 10, 2018 Share Posted September 10, 2018 I seem to have over 1,000 of this error: htdocs/classes/phpMailer/PHPMailerAutoload.php:45 - __autoload() is deprecated, use spl_autoload_register() instead How do I fix this? Link to comment Share on other sites More sharing options...
bsmither Posted September 10, 2018 Share Posted September 10, 2018 Please check the version of PHP the CubeCart is using. In admin, PHP Info. The code that is executing suggests that PHP is a version older than 5.1.2. Link to comment Share on other sites More sharing options...
vidmarc Posted September 10, 2018 Author Share Posted September 10, 2018 PHP info: PHP Version 7.2.8 Link to comment Share on other sites More sharing options...
bsmither Posted September 10, 2018 Share Posted September 10, 2018 I think this is what is happening. PHP will first perform a process against a script when it is first called known as "compile time". Then, the logic is figured out, a few other things happen, and we then have "run time". At "compile time", PHP will notice that the __autoload() functionality is not used anymore and issue a notice. It does not matter if the code is never executed at "run time". There are a few places where we need to tell CubeCart to not give us any notice of these deprecation errors. In the file ini.inc.php, near line 19: From: error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); To: error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED & ~E_USER_DEPRECATED); In the file /controllers/controller.index.inc.php, near line 37: $GLOBALS['smarty']->error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING; This a setting specific to Smarty, the template rendering engine. We can change this, but it is not really necessary - yet. In the file /classes/debug.class.php, near line 102, find: error_reporting(E_ALL ^ (E_NOTICE | E_DEPRECATED | E_USER_DEPRECATED)); This command is executed if debugging is disabled. However, if debugging is enabled, then everything gets logged (line 85). Link to comment Share on other sites More sharing options...
vidmarc Posted September 10, 2018 Author Share Posted September 10, 2018 Is this a bug of some sort? Link to comment Share on other sites More sharing options...
bsmither Posted September 10, 2018 Share Posted September 10, 2018 An annoyance, actually. In PHP 8, __autoload() will be removed, and then it becomes something to fix -- which PHPMailer will have this fixed on their next version. However, it would be worthwhile to suggest the code change to ini.inc.php in an issue in the Github. Link to comment Share on other sites More sharing options...
vidmarc Posted September 10, 2018 Author Share Posted September 10, 2018 Could this be fixed via the setting in Admin -> Advanced Settings -> Email -> Sending Method? Link to comment Share on other sites More sharing options...
bsmither Posted September 10, 2018 Share Posted September 10, 2018 No, sorry. The fact is, PHPMailer is the master controller for all email functionality. CubeCart will tell PHPMailer to use PHP's mail() function if that is what is selected in admin. I would think the reason is so that PHPMailer can execute a controlled attempt to send an email, and if a failure happens, like if there is no server-installed mail agent or the PHP.INI file isn't actually configured to use it, there would be a catchable resolution and graceful response -- as opposed to something much more WTF-like. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.