Hook overwrite (deprecated)

From Sohowiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
;Syntax : hook_overwrite(source file name, plugin file name)
 
;Syntax : hook_overwrite(source file name, plugin file name)
 +
  
 
;Description  
 
;Description  
Line 6: Line 7:
  
  
'''Example 1 - calling hook_overwrite from your install_manifest.php'''
+
 
<pre>hook_overwrite("sohoadmin/program/main_menu.php", "your_modded_main_menu.php");</pre>
+
;Example 1 - calling hook_overwrite from your install_manifest.php
 +
:<pre>hook_overwrite("sohoadmin/program/main_menu.php", "your_modded_main_menu.php");</pre>
 +
 
 +
 
 +
;Notes/Tips
 +
:The hook_overwrite method is utilized in the article "[A first plugin]"
 +
:Try to avoid using this method if possible, because it makes your plugin more succeptable to conflicts with other plug-ins, especially on central files that many other plugins might be touching. hook_overwrite is meant to be a "last resort", "bazooka", and/or "club over the head" method for cases where modifications to the original source file are so extensive (or so numerous) using hook_replace() would require you to spend the next 48 hours of your life chronicalling all of the individual changes in your replacement manifest.

Revision as of 18:16, 18 May 2006

Syntax 
hook_overwrite(source file name, plugin file name)


Description
Completely overwrites a source file with the file you specify.
Original source file is renamed to filename.php-[plugin_folder_name] so it can be restored if plugin is uninstalled.


Example 1 - calling hook_overwrite from your install_manifest.php
hook_overwrite("sohoadmin/program/main_menu.php", "your_modded_main_menu.php");


Notes/Tips
The hook_overwrite method is utilized in the article "[A first plugin]"
Try to avoid using this method if possible, because it makes your plugin more succeptable to conflicts with other plug-ins, especially on central files that many other plugins might be touching. hook_overwrite is meant to be a "last resort", "bazooka", and/or "club over the head" method for cases where modifications to the original source file are so extensive (or so numerous) using hook_replace() would require you to spend the next 48 hours of your life chronicalling all of the individual changes in your replacement manifest.
Personal tools