Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Options setup to new PHP Class #19

Open
nimmolo opened this issue Jan 16, 2017 · 1 comment
Open

Move Options setup to new PHP Class #19

nimmolo opened this issue Jan 16, 2017 · 1 comment

Comments

@nimmolo
Copy link
Collaborator

nimmolo commented Jan 16, 2017

During debugging I have noticed that the options seem to be loaded many many times during admin init, and I think there is something fundamentally inefficient about the way I've written it. I just don't understand OOP/Classes enough to know how to fix it.

Since each host formats author options a different way, i suspect it may be a case of creating an abstract class in core, and extending it for each host. anyway Silvia if you get a chance, could you summarize for me the proper way to do this?

I think i can do it if you can explain the principle involved! :-)

@silviapfeiffer
Copy link
Owner

I was indeed thinking about creating an abstract class and including it into each of the other classes, but on reflection, it would be difficult to keep the state of the options synchronised. What if somebody else logs onto the site and changes the options while you have them cached and are working on a local copy? It's not simple to avoid re-reading the options all the time. It could be done by checking the timestamp of the last write to Options and if it hasn't changed, use an already cached version. But I'm not sure it makes much sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants