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

Where can I find multistore.php file? #10

Open
dashaluna opened this issue Mar 31, 2016 · 6 comments
Open

Where can I find multistore.php file? #10

dashaluna opened this issue Mar 31, 2016 · 6 comments

Comments

@dashaluna
Copy link
Contributor

Hello,

In singlestore.php https://github.com/beaulebens/keyring/blob/master/includes/stores/singlestore.php#L5 it says to look at multistore.php for multisite install. However, I can't find that file. Could you give me some tips please?

Thank you!

@beaulebens
Copy link
Owner

Hi Dasha,

Unfortunately, that was me being a little bit too optimistic about how much time I'd be able to spend on writing generic/portable code for Keyring.

There's not currently a version of "multistore" available, since the closest I have is a completely custom one, that uses custom tables and everything.

The original idea here was that you'd somehow be able to define a specific site (constant?) that would become the storage engine for a shared token store for multi-site installs, and then Keyring would always look in that specific WP DB for tokens, but that's never been specifically pursued/written. Failing a specifically-defined site like that, the default would probably be the main/core (blog_id=1) site on a multisite install.

If you ended up writing something along those lines, I think it'd make a valuable addition to the Keyring bundle though, and would like to add it.

@dashaluna
Copy link
Contributor Author

Thanks @beaulebens for explaining. Oh I see what you mean. I haven't written anything specific to multisite install. Using the singlestore is working fine storing the tokens in a site of a user. Are there any disadvantages of that?

@beaulebens
Copy link
Owner

The main idea behind a multistore was going to be in allowing users to use their tokens across all sites within a multi-site install. If your individual sites are quite separate, and you want to keep tokens isolated to each site, then the singlestore should (I think!) work fine for that.

@dashaluna
Copy link
Contributor Author

Oh I see, now it makes more sense! Thank you for explaining.

@JJJ
Copy link
Contributor

JJJ commented Dec 20, 2016

Now that site objects have pretty good caching, this would work OK by using switch_to_blog() to the site ID where connections and tokens are stored.

We do similar with BuddyPress for certain API items now, and it works well without much in the way of snags that would affect Keyring (mostly: permalinks.)

If there's any real need for this from anyone still, I'm happy to whip up a proof-of-concept, even based on @beaulebens's approach if he's willing to share his cobbled together version.

@pento
Copy link
Collaborator

pento commented Feb 26, 2020

I've been playing around with this a little bit. If y'all still have opinions on what multisite Keyring might look like, and how it could work, I'd appreciate comments on #65. 🙂

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

4 participants