Advertisement:
Anonymous Login
12-05-2016 07:48 PM

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004619SMF 2.1[All Projects] public2012-08-14 11:33
Reporter[SiNaN] 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusresolvedResolutionfixed 
Summary0004619: Allow hooks to include a file
DescriptionIt would come in very handy if hooks could include a file. It would be something like:

add_integration_function('integrate_load_theme', 'my_function', '$boarddir/MyFile.php', true);

When the hooks is called, it would include the file is one is defined before calling the function.

I really regret not having added this when I updated hooks for RC4.
Tags2.1
Attached Files

-Relationships
+Relationships

-Notes

bugnote:0013705

groundup (SMF Friend)

You'd need to add it to that array. What would you use to split it? I'm thinking a colon would be fine. The column, in MySQL, would look like: func1,func2,func3,file1:func4,file1:func5,file2:func6

bugnote:0013707

[SiNaN] (Viewer)

Colon looks fine.

bugnote:0014146

AngelinaBelle (SMF Friend)

In the further future, will it be advantageous to take hooks completely out of $modSettings so they can have a better data structure?

bugnote:0014171

Suki (Developer)

Agree, $modSettings is way too bloated already.

bugnote:0014243

groundup (SMF Friend)

An alternative to even having this is to use an autoloader. It would be very easy to do and you could use the autoloader to increase the internal security of your functions.

bugnote:0014664

emanuele (Viewer)

commit 1f94fbe8ad83523a960a094fb519d370b9a104c1
Author: emanuele
Date: Tue Jul 10

    That should allow people to define a file to include when they add a function to a hook

Plus few other commits to fix the bugs :P
+Notes
MantisBT (Modified for SMF Intergration)[^] Copyright © 2000 - 2010 Mantis Group