Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#1278 closed feature request (duplicate)

General callbacks registration

Reported by: bergie Owned by: bergie
Priority: blocker Milestone:
Component: MidCOM core Version: 9.09 Mjolnir
Keywords: Cc:

Description

Currently callbacks to Midgard signals in MidCOM are done by various libraries directly. However, it would be better to handle callback registration as a service that could be configured using normal MidCOM configuration stack.

http://www.midgard-project.org/documentation/php_events/

Something like:

callbacks:
    article_updating:
        class: midgard_article
        event: action-update-hook
        callback:
            - midcom_core_services_authorization_owner
            - on_updating

Change History (6)

comment:1 Changed 8 years ago by indeyets

maybe something like this?

events:
  - 
    class: midgard_article
    event: action-update-hook
    callbacks:
      - 
        class: midcom_core_services_authorization_owner
        method: on_updating
        additional_parameters: ['hello', 'world', 42, 'foo', 'bar']
      - 
        class: midcom_core_services_webhook
        method: send
        additional_parameters: ['http://www.example.com/article_is_updated', '19afa2a4a37462c7b940a6c4c61363d49c3a35f4']
  - 
    class: midgard_article
    event: action-create-hook
    callbacks: []

comment:2 Changed 8 years ago by indeyets

Also, we can introduce wildcarding for classes and events:

events:
  - 
    class: *
    event: action-update-hook
    callbacks:
      - 
        class: universal_handler
        method: something_was_updated
        additional_parameters: []
  - 
    class: midgard_article
    event: *
    callbacks:
      -
        class: universal_handler
        method: something_happened
        additional_parameters: ['midgard_article']

comment:3 Changed 8 years ago by bergie

  • Milestone changed from 9.09 Mjolnir to 9.09.1 Mjolnir

comment:4 Changed 7 years ago by bergie

  • Milestone changed from 9.09.1 Mjolnir to 10.03 Ratatoskr
  • Priority changed from major to blocker

comment:5 Changed 7 years ago by bergie

  • Resolution set to duplicate
  • Status changed from new to closed

comment:6 Changed 7 years ago by anonymous

  • Milestone 10.05.1 Ratatoskr deleted

Milestone 10.05.1 Ratatoskr deleted

Note: See TracTickets for help on using tickets.