Jump to content
vidmarc

Error log query

Recommended Posts

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?

 

Edited by vidmarc

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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).

 

Share this post


Link to post
Share on other sites

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.

Edited by bsmither

Share this post


Link to post
Share on other sites

Could this be fixed via the setting in Admin -> Advanced Settings -> Email -> Sending Method?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...