This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Function conflicts
#1
Exclamation 

There are some functions in Commentics that interfere with other php scripts (actually the other way around in my case).

I was trying to include Commentics in WordPress instead of the default comment script, but ran into a couple of function conflicts. Specifically, the get_settings() function and some others are present in both scripts, so redeclaring them is problematic (aka doesn't work). The best solution I can think of is renaming Commentics' functions to include a prefix to avoid conflicts with other scripts.

I believe that this is a pretty big issue because trying to integrate it with some other scripts could also be a problem. I suggest a prefix of "cmtx_" for each function as it's quite short. Also, only the front-end functions would need changing as the back-end isn't meant to work with other scripts.

A sample error for reference:
Code:
Fatal error: Cannot redeclare clean_url() (previously declared in http://localhost/wordpress/wp-includes/deprecated.php:2089) in http://localhost/comments/includes/functions/processor.php on line 1180

P.S. I suddenly got the itch to really start working on this script now. Can't wait till you get back from the hospital, Steven.

I'm giving you three guesses...
Reply
#2

Yeah this definitely needs sorting. Your suggestion of prefixing each function with 'cmtx' is good. It will be done for v1.3.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post

Forum Jump:


Users browsing this thread: 1 Guest(s)