mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 21:15:56 +03:00
[GH-ISSUE #261] Get config variables in site module #223
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#223
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @Yamakasi on GitHub (Feb 9, 2018).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/261
What is the best way to get the config-variables in the site module ?
I guess it need to be something like this:
@jasonmunro commented on GitHub (Feb 9, 2018):
You have not provided enough context to answer your question. The code you posted appears to be object properties and a constructor that takes the config object as an argument, however there is no class definition, and no information about where this object would be instantiated from, which is required to know if the config object is in scope to be used as an argument.
@Yamakasi commented on GitHub (Feb 9, 2018):
It'sclearly not in scope so I'm trying to find some reference in the code and found that way in the code when the config needs to be loaded.
Normally, or mostly, you simply do a $foo = new Class() you want but because of all the Extending/Inheriting this is a little bit confusing what the best and preferred way is.
@jasonmunro commented on GitHub (Feb 9, 2018):
The config object is in scope inside the session class as $this->site_config, and from inside handler modules as $this->config. It is not possible to access it from a generic context. So if your class is extending the session or auth classes in the site module set, it's already present as $this->site_config.
@Yamakasi commented on GitHub (Feb 9, 2018):
Yes fixed, it's already present indeed.
Thanks!