• 0

Unset a function?


Question

Is there a way in PHP to unset/delete a function that's already been made, so that I can reuse the name?

Reason is because in vbulletin3.5 there's the plugin system which i want to use to edit a function but there's no hooks in that function,so what i want to do is just copy/paste the code, make my edits, and put it into a plugin that cmes after the function has been made. Problem with just creating it is that i get the function already exists cannot redeclare message.

Thanks. :)

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0
Or just make your edits directly into the VB function

586756679[/snapback]

I'm trying to keep the forum file-edit free for ease of upgrading...

This is the only file edit the forum has atm, i'm just trying to make it into a plugin so there will be none to worry about.

Link to comment
Share on other sites

  • 0
You can use rename_function

<?php
rename_function('original_name', 'new_name' );
?>

and then redeclare the original function.

override_function may work too.

Info:

override_function

rename_function

586761508[/snapback]

I tried rename_function. Here is the code I used:

//Rename the old function
rename_function('strip_quotes','strip_quotes_non_nested');

But then I get this messsage on the forums:

Fatal error: Call to undefined function: rename_function() in /home/filesh/filesharingtalk.com/html/vb3/global.php(233) : eval()'d code on line 156

:(

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.