ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Possible Add-on

February 24, 2012 10:15am

Subscribe [2]
  • #1 / Feb 24, 2012 10:15am

    Arazmus

    4 posts

    Hello all.

    I have a requirement at work that means i have to be able to call a custom hook in a EE class thats not got any hooks.

    To do this i had to put the hook there and its supporting code ( =&get;_instance() )

    So i was thinking that part of this project i am on will probably mean doing this a few times in a range of EE core files.

    My question to the EE Community is this:
    Would Plugin that lets you choose the file, class, function and add in custom hooks be of use to anyone?

    Im thinking of writing it and it will have the ability to load all core files, add-on etc and let you specify a hook name and position in the function to add the hook to - im thinking that auto adding hooks would work for the start and end of a function but not sure on adding a hook to the middle of a function (this could be done if i display the function code and let the user add in the hook manually)

    This could then allow third party add-ons to use the custom hooks to build even more functionality.

    Reason for posting this is that i am building a plugin that creates/edits/deletes tables when channels are created/edited/deleted in order to use channels to make a relational database for a work project and the channels functions have no hooks.

    Thoughts?

  • #2 / Mar 08, 2012 4:32pm

    Arazmus

    4 posts

    just an update on this - i started it and am almost done - I have the following done:
    -Backup existing file
    -Add Custom Hook Code
    -Save file
    -Add information to DB

    To do:
    -Restore hooks (link in cp to restore selected hook when/if file has been updated)
    -Delete hook

    Possibles:
    -Auto Scan hooks - if not there but in DB then restore hook

    any thoughts?

  • #3 / Mar 10, 2012 12:36pm

    Man With A Peg

    124 posts

    Interesting. I am working on a slightly expanded version of the same concept. Instead of automatically generating hooks, it would let you modify the code yourself.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases