Advertisement:
A2Hosting

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004619SMF 2.1[All Projects] public2011-02-07 13:182012-08-14 11:33
Reporter[SiNaN] 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
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

-  Notes
(0013705)
groundup (SMF Friend)
2011-02-07 18:57

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
(0013707)
[SiNaN] (SMF Friend)
2011-02-08 01:56

Colon looks fine.
(0014146)
AngelinaBelle (SMF Friend)
2011-07-29 07:51

In the further future, will it be advantageous to take hooks completely out of $modSettings so they can have a better data structure?
(0014171)
Suki (Developer)
2011-10-03 12:17

Agree, $modSettings is way too bloated already.
(0014243)
groundup (SMF Friend)
2011-10-29 16:01

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.
(0014664)
emanuele (Developer)
2012-08-14 11:33

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
MantisBT 1.2.8 (Modified)[^] Copyright © 2000 - 2010 Mantis Group