Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP Deprecated: Function .. Don't panic!


FWR Media

Recommended Posts

I just posted this somewhere but thought it was worth its own post as we'll be seeing more posts asking what they should do with this error.

 

Simple ..

 

catalog/includes/application_top.php line 17(ish)

 

Find ..

 

  error_reporting(E_ALL & ~E_NOTICE);

 

Change to ..

 

  error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);

 

Note: Eventually (in a few years) when PHP 6 becomes mainstream you will have to deal with the deprecated functions in osCommerce, but for now this is fine.

Link to comment
Share on other sites

These: http://www.oscommerce.com/forums/topic/341737-function-ereg-replace-is-deprecated/page__p__1434612__hl__eregi%20deprecated__fromsearch__1entry1447311 and

http://www.oscommerce.com/forums/topic/342525-page-script-error/page__p__1430745entry1430745 list various fixes needed to deal with the deprecated functions and avoid the messages in PHP 5.3+.

 

Of course, just turning off the warnings will also work for the time being (until you go to PHP 6), but that is a bit risky in that you might forget to deal with the problem until it's too late. I guess the best course of action would be to turn off the warnings AND tie a string around your finger (very tightly) to remind you to deal with the problem soon. Turn the warnings back on after fixing the code, so that anything else that shows up can be caught.

Link to comment
Share on other sites

I guess the best course of action would be to turn off the warnings AND tie a string around your finger (very tightly) to remind you to deal with the problem soon

 

:D

Link to comment
Share on other sites

I would expect all functions being depreciated to be long gone in osCommerce way before PHP6 is released

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

Link to comment
Share on other sites

I would expect all functions being depreciated to be long gone in osCommerce way before PHP6 is released

 

Well that's nice Mark .. but as is the norm with the average osC user most of the sites out there sadly will not be on your shiny new code.

Link to comment
Share on other sites

but as is the norm with the average osC user most of the sites out there sadly will not be on your shiny new code.

 

v2,2 is being made PHP 5.3 compatible (and actually already is in github) which will fix all of the current depreciated warnings. I can't speak for PHP 6 since we are unlikely to see that in the wild for another 18 months at least but looking at the list of things depreciated most could be fixed way before then.

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...