Anonymous Login
06-19-2018 07:37 PM

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004619SMF 2.1[All Projects] public2012-08-14 11:33
PrioritynormalSeverityfeatureReproducibilityhave not tried
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.
Attached Files




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


[SiNaN] (Viewer)

Colon looks fine.


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?


Suki (Developer)

Agree, $modSettings is way too bloated already.


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.


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