[cookienotice] Fix wrong type-hint in hook function cookienotice_page_content_top #1270
No reviewers
Labels
No labels
2018.09
2019.01
2019.03
2019.06
2019.09
2019.12
2020.03
2020.06
2020.09
2020.12
2021.03
2021.07
2021.09
2022.02
2022.06
2022.09
2022.12
2023.04
2023.05
2023.09
2024.03
2024.06
2024.09
2024.12
dependencies
Hackathon 2021
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: friendica/friendica-addons#1270
Loading…
Reference in a new issue
No description provided.
Delete branch "bug/fatal-errors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Probably fixes https://github.com/friendica/friendica/issues/11695
Mostly the
$b
name has confused me. Cannot we make a naming-convention here, e.g. if it is HTML code, use$body
($o
for historical reasons but that doesn't need change),$data
if it is an array? At least not$b
everywhere.Sure, go ahead.
I will do it more in a controlled fashion. :-)
Somewhere in the future (:D) I do want to rewrite the add-on classes at all .. to make them testable, like for the s3 storage classes .. and to avoid DB loadings and with type safe parameters depending on the hook calls not on the Hook class itself
How do you plan on doing the last part?
Using the observer pattern and passing concrete, event specific, interfaces as parameters.
Observer = Addon-Functions
Subject = Hooks
And inside the Addon-constructor, I add the the functions as observers into the subjects. So no need of any DB call and I can customize observer and subjects as I like, because I will introduce a common interface for all addons :)
I must confess it's just inside my brain now, so I'm not sure about the pitfalls .. yet :D
We still need a DB call to figure out all the addons that need to be instantiated, right? And then they can subscribe to any hook they need. I'm looking forward a prototype implementation.
In my old
mailer
software I cached these hooks (I called them filters) to speed up the registration a little, so it doesn't have to go through all "hook" registrations but just read the database table and fill the "filter" array. Maybe @nupplaphil you can grab a few ideas: https://git.mxchange.org/?p=mailer.git;a=blob;f=inc/filter-functions.php;h=de21a6fd9c69a8fe4e1d0e050fe5ccc158ced7b0;hb=refs/heads/0.2.1-FINAL