View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0004619 | SMF 2.1 | [All Projects] | public | 2011-02-07 13:18 | 2012-08-14 11:33 | ||||
Reporter | [SiNaN] | ||||||||
Priority | normal | Severity | feature | Reproducibility | have not tried | ||||
Status | resolved | Resolution | fixed | ||||||
Summary | 0004619: Allow hooks to include a file | ||||||||
Description | It 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. | ||||||||
Tags | 2.1 | ||||||||
Attached Files |
|
![]() |
|
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 |
[SiNaN] (Viewer) 2011-02-08 01:56 |
Colon looks fine. |
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? |
Suki (Developer) 2011-10-03 12:17 |
Agree, $modSettings is way too bloated already. |
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. |
emanuele (Viewer) 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 |