-
Notifications
You must be signed in to change notification settings - Fork 22
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
b doesn't support multisite #12
Comments
…ite directory as mapped by sites.php.
…ite directory as mapped by sites.php.
Yes, I get the following messages when running
And the following error when running the same from a multisite directory (e.g.
EDIT: I get those message before trying this issue's PR... Will report back once I've tested the PR. |
After applying the patch/PR I get the following results from Backdrop's root dir and a site dir respectively:
This is certainly an improvement on my previous attempt. |
But I discovered that "Backdrop CMS Installation detected; wooot;" in my site directory is incorrect. There are two issues:
|
Here's an alternate PR which works for me: #35 No need for a core patch and the change is relatively small. Please test and review. |
Some info about how to use it: there's no new parameter in my PR. You either Examples for a multisite install:
|
For the last few days I've been working on this issue (sorry to not mention it sooner), and have come up with the following PR. It does the following:
This PR therefore allows you to run Also, any combination of using the
Or:
The "Current directory and --root don't match..." error is because Feedback, suggestions, complaints welcome 😉 Also lots of testing! |
Updated my PR to use PHP functions for getting parts of the path (no functionality changes). Thanks @indigoxela! |
@BWPanda your PR needs some more work, as it is currently conflicting with your latest merges. |
Yeah, thought it might. Thanks. Also, before I merge this I'm hoping to get some tests happening (#19) and also to hear feedback from @jlfranklin (since it was his issue originally and also his PR)... |
Coming from #60. Thank you for all the hard work. Any ETA for the merge? |
I have updated the PR to work with the latest changes in |
Or maybe I'll just patch Backdrop in the test environment setup... |
That sounds nasty. Many thanks for your effort to make b a handy tool for Backdrop. What a progress in such a short time! |
Trying to keep up with the latest changes... ;-) It seems to me, we need a more robust way for core file inclusion. See my comment in https://github.com/backdrop-contrib/b/pull/37/files This is how drush seems to do it: |
I think it's fine. If you look a few lines up you'll see that we change to the root directory before running those commands. |
Hm, I thought it might, but on my testing machine I get: Just to make sure: this is the correct repo and branch? https://github.com/BWPanda/b/tree/issue-12 |
@indigoxela Yep, that's the right repo/branch. I posted a comment in the PR for you. |
I'll answer your question/comment here, so the PR isn't bloated... Ha! Silly me, I didn't checkout the right branch after doing a fresh clone of your repo. Much better now. But... Using --url from outside doesn't work at all, from inside it's unreliable, because different depending on the current directory. For single site installs it's pretty much the same (inside/outside...) It would be cool, if this all could get more robust. Ideally more like drush does it. And without php errors and exceptions. ;-) |
The first few require_once in b.php are dangerous. Use Example: This fixes the exception mentioned in my previous comment. As soon as BACKDROP_ROOT is set in b_init(), use that constant consequently in all require_once for Backdrop files to prevent problems with different paths. For instance in updatedb.b.inc. Checking if this is an (already) installed Backdrop could get improved. If neither "--root" nor "--url" were given as option, step up/down the tree to find a usable settings.php, which doesn't contain the initial value. Or a sites.php. Of cource with depth limits. If "--root" was provided, verify that the settings.php right there is OK (has database settings different from default value). If "--url" was provided - hmmm - not sure yet... This probably must happen inside an install... step up/down? @BWPanda what do you think? |
Thanks for the review/feedback @indigoxela! I've updated my PR with your suggested fix for I've also created some additional issues for the other things you mentioned: #83 and #84 Finally, regarding your comments about the |
First of all: cool, the exception triggered by the wrong file included is gone. But I'm confused regarding the root option. Somewhere outside Backdrop, if I try: Sure the path doesn't match. That's why I set the option. If I can only use that option from the exact directory, it is pointless anyway, or am I missing something? The url option from inside a multisite install works fine. |
Anyway, extending the functionality could get handled in a follow-up issue. |
Thanks @indigoxela. That message could use some re-wording I guess. The point of it is that if you don't specify a I'll create an issue to make this wording better. |
Tests passing, so committed this PR! Multisite-specific tests can be added in #86. Special thanks to @indigoxela for the invaluable testing and suggestions, and to @jlfranklin for the initial issue/PR. |
B has no way to say
b --root /var/www/backdrop --url www.example.org
to selectsites/example.org/settings.php
instead of/var/www/backdrop/settings.php
.After some time of silence here, we now have several options:
@jlfranklin's PR: #21
@indigoxela's PR: #35Deprecated in favour of #37@BWPanda's PR: #37
The text was updated successfully, but these errors were encountered: