Jump to content

hooks how to use it


dupemaster

Recommended Posts

here is the problem I have file that has a function Func1 which is called by another function Funct2  in another file. what i need to do is write  a Funct3  and put it in a third file which will also be called when the first function is called if either the funct3 returns falls funct 1 must return false to funct 2

does this make any sense if it does help me
Link to comment
https://forums.phpfreaks.com/topic/35714-hooks-how-to-use-it/
Share on other sites

sorry

            there are 3 files
            file 1 has a function named    whoareu()
            file 2 has a function named      letmecheck()
          whoareu() calls letmecheck();       

now this is the part that i am not 100 % sure of

              letmecheck() function does a bunch of checks if  it fails any of the checks  it returns false
but unfortunately the person who wrote that function forgot to check for a few thinngs and now i have to do that extra checking. but i am not allowed to change anything in that package, so i have to write a third file which does the additional checks so  when i am done

                        this is what should happen

whoareu() calls letmecheck()
while letmecheck() is running it should also check the conditions in the third file       

I hope this makes sense

thank you
Link to comment
https://forums.phpfreaks.com/topic/35714-hooks-how-to-use-it/#findComment-169222
Share on other sites

So you have to have letmecheck() run checks from function3 but you can't edit letmecheck()? Not sure how you can do that. Unless in the main script where you call whoareu()...you test if it returns false, meaning that letmecheck() is false, and if it does return false then run function3. I think might work if I'm understanding you correctly.
Link to comment
https://forums.phpfreaks.com/topic/35714-hooks-how-to-use-it/#findComment-169316
Share on other sites

the checks in the third file only need to be done if the check in letmecheck() passes  you could  think of this as a chain of if loops if one fails all fails. that's the problem, if i was allowed to edit letmecheck() this would have been easy but i dont have the right to do that, so what are my options
Link to comment
https://forums.phpfreaks.com/topic/35714-hooks-how-to-use-it/#findComment-169792
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.