Problem/Motivation
Setting up Drupal for the first time is a hard task, see http://matthewgrasmick.com/compare-php-frameworks.
This is quite a sad state compared to other project like in the node world:
npm require X
npm install
🍷
The goal of this issue is to provide a similar experience for first time Drupal users.
This command might not be for you when you
- Know how to run docker
- Have drush or drupal console installed on your machine
- You know already how to setup Drupal
Proposed resolution
The steps we need to execute are:
- Install Drupal (setting the file system up, creating a database, install some install profile)
- Start a webserver
Luckily there is SQLITE and the PHP built in webserver out there.
Detailed plan
- Ensure
composer install
was executed - Install Drupal using sqlite
- Start the PHP build in webserver using #1543858: Add a startup configuration for the built-in PHP server that supports clean URLs
- Communicate that as the simplest way to try out Drupal on your system by adding documentation to INSTALL.txt
How to test
- Apply patch
- Run
$ php core/scripts/drupal quick-start
from the command line - Wait till the browser is opened up.
Remaining tasks
None
User interface changes
Videos:
- https://vimeo.com/264667336
- https://drive.google.com/file/d/17uRiPG6iTcFIxUV_uggajm0HBM1C9I46/view?u...
API changes
API additions to install_drupal()
and install_run_tasks()
. These methods take a new argument of a callable that allows CLI processes to implement a progress bar like the interactive installer.
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#296 | 2911319-2-296.patch | 42.26 KB | alexpott |
#296 | 294-296-interdiff.txt | 322 bytes | alexpott |
#294 | interdiff-2911319.txt | 1.43 KB | dawehner |
#294 | 2911319-294.patch | 42.26 KB | dawehner |
#293 | interdiff-2911319.txt | 1.46 KB | dawehner |
Comments
Comment #2
yoroy CreditAttribution: yoroy at Roy Scholten commentedMaybe similar to #2876001: Installerless Drupal?
Comment #3
dawehnerIt is a bit indeed. The way how I see it is that #2911319: Provide a single command to install & run Drupal is far less of a radical proposal :)
Comment #4
kenorb CreditAttribution: kenorb commentedBtw. One command to install and run Drupal:
drush qd
See: What is the easiest way to install clean Drupal from scratch using drush?
Comment #5
kenorb CreditAttribution: kenorb commentedComment #6
kenorb CreditAttribution: kenorb commentedComment #7
alexpottPerhaps also related is #2242947: Integrate Symfony Console component to natively support command line operations as that will make running commands simpler.
Another idea would be to add a command to the root composer.json that can do this. See https://getcomposer.org/doc/articles/scripts.md#writing-custom-commands
Comment #8
dawehnerNote: #2869825: Leverage JS for JS testing (using nightwatch) has a command to install Drupal for tests, which might be interested to have a look at as well.
Comment #9
alexpottIn #1543858: Add a startup configuration for the built-in PHP server that supports clean URLs we discussed the need for documentation in core files. This issue should add it.
Comment #10
dawehnerHere is some start of a naive implementation ...
Comment #11
alexpottJust tested the command - so sweet. Nice work @dawehner.
I think we should add some resilience - for example what happens if sqlite is not available? Also the output could be more instructive as to the url to visit and the admin user password. Ah... see code review @dawehner++
Lol I should have looked at code. So we need a better message but awesome to see this!
Yep this would be super nice. Of course such things need validation :(
These look like sensible defaults for a dev environment.
I think before doing something destructive we should involve the user.
It might be worth having two command dev-start and dev-install. dev-start should only do an install if there's no settings.php otherwise it could just start the webserver.
Comment #12
Chi CreditAttribution: Chi commentedOn my localhost when I access to core/scripts/dev-start.php through web it tries to remove settings.php file.
I know this should be handled by proper server configuration but anyway it would be more secure if we take care about it.
For instance in the core/scripts/db-tools.php there is the following condition.
Comment #13
Chi CreditAttribution: Chi commented+ $builder = new ProcessBuilder([$binary, '-S', 'localhost:8888' , '.ht.router.php']);
There is a nice implementation for this in Symfony but unfortunately it is tied to the framework.
https://github.com/symfony/symfony/issues/24534
Comment #14
dawehnerWhile it would be super cool to have some a component, I don't think its something we should wait for. For me at least its all about having the command available, we can always rewrite the internal completely later at some point.
Comment #15
Wim Leers❤️❤️❤️
Comment #16
webchickSlightly adjusting the tag, since with this version it says this on the project page. 😂
Comment #17
dawehnerThat's hilarious!
Comment #18
borisson_Comment #19
jibranWhat is the difference between #2926633: Provide a script to install a Drupal testsite and this?
Comment #20
dawehnerI commented on https://www.drupal.org/project/drupal/issues/2926633#comment-12382108
Comment #21
dawehner* Moved it into a symfony command file
* Added support for install profile + language
Comment #22
jonathanshawComment #23
alexpottSome unintended whitespace.
Needs to be
$root = dirname(dirname(dirname(dirname(dirname(__DIR__)))));
This process can take a long time. Maybe we can use the process command to fork and run this in a separate process and use Symfony's stuff to have a progress bar? At the very least we should have some output prior to this saying we're installing and this might take some time.
The output here should list how to connect to the site and credentials etc..
Can we move this near the top of the file - after configure I was surprised where this was in the file.
Comment #24
alexpottAlso, should have said typing in a single command to get umami up and running for a demo is really cool! Nice work @dawehner
Comment #25
dawehnerWell, I thought about it. I'm really not sure at all here. One the one hand sure, on the other hand, if you want this you can already use drush. Well, for it being useful for core development having two commands make sense. I combined them together in a composer script though.
Comment #26
Chi CreditAttribution: Chi commentedUnused use statements.
Can we use more specific type
Composer\Autoload\ClassLoader
?The method parameter needs to be in snake case.
- DevStartCommand
+ DevInstallCommand
Unused variable
$root
.The function name and description do not correspond to what this function really does. Also return type should be
string|null
.Same thing here. This code does not install Drupal. Also 'drupal' needs to be capitalized.
Whi not
$root = __DIR__ . '/../../../../..';
?Per the option description default value should be 'testing'.
Not quite correct, since this can install any installation profile.
This needs to be printed to std error.
$output->getErrorOutput()->writeln('PDO SQLite extension is required for this opertaion.');
Also I would make the message more verbose and remove ellipsis.
Trailing whitespace
ProcessBuilder is deprecated.
What does '0.1.0' stand for? Can we use
\Drupal::VERSION
isntead?This return statement does not stop the application from beeing exectured. Since both boot() and install() methods are rather small I propose placing the entire command code to execute() method. In any case we need to return correct exit code from the application.
Missing file doc comment.
Per the coding standard each element of this array should be broken into its own line. Also space after localhost:8888 is redundand.
Another CS issue. The ending semicolon should not be on its own line.
Comment #27
mglamanAdding in something from Slack chat. We can support the builtin webserver on a random port. Here's some code I used to pick random ports for PhantomJS and Chrome web drivers
Source https://github.com/mglaman/webdrivers/blob/master/src/DriverFactory.php#L63
Comment #28
dawehnerI don't really want to hardcode an autoloader
Does it, see https://www.drupal.org/docs/develop/standards/coding-standards#naming
I changed the text.
The process class is way nicer
¯\_(ツ)_/¯ I think any version number doesn't mean anything
I tried to be in sync with what #2926633: Provide a script to install a Drupal testsite is doing
Comment #29
dawehner@mglaman's snippet worked perfectly!
Comment #30
mglamanFrom the issue summary
But there isn't a default command (still `list`). So I see
Do we want to default to a command which runs `install` and then `start`? so it can be an all in one command? I guess DevInstallCommand is not re-entrant safe and assumes you want to reinstall if you run it again. And DevStartCommand should only worry about running the built-in server.
Wherever this is documented should mention it is a two-step process for the first run, single command thereafter.
EDIT: Command outputs
Install
Run builtin
Random ports ftw! Able to access installed site.
Comment #31
mglamanI totally missed this. This is great but has one problem.
As stated in my last comment, DevInstallCommand is not reentrant. So if an unexpected user tried to execute `dev-site` thinking it'd execute like `npm start` they would blow away their existing site.
I think when `install` checks for an existing install it should exit successfully if there is a site. Unless a `--force` option is passed. Kind of like how Drush asks you "Are you sure?" for `site-install`. This way we can provide a `npm start` like command for people to get up and go.
Comment #32
dawehnerGood idea!
Note: This isn't working yet.
Comment #33
andypostAfter reviewing this issue after #2242947: Integrate Symfony Console component to natively support command line operations
I see 2 different ways to boostrap core & checks for ability to do it.
Mostly polished
class Application extends GenericApplication
(generic is SF one)So if install command will fail we just get NULL and call to start dev server without checking "bootstrapability" of core
Making both host:port to listen configurable
Maybe parts of
.htrouter
could be reusedProbably #2289405: [META] Port all shell scripts to console commands is better place to discus bootstrap & error handling
all this places reports to err and return non-zero (or exception?) that's what raised in 2242947#98
let's came to common ground for all commands to be POSIX in #2289405-21: [META] Port all shell scripts to console commands
nit, trailing whitespace
chdir() does not boot core, maybe better call it chroot5Dirs()
Actually this is what #2242947-96: Integrate Symfony Console component to natively support command line operations means that it can catch by tests - so could be a problem if this method will be called twice
Why only port configurable? host should be as well
Please, make separate commands) It will be more useful cos I don't wanna reinstall site each time I wanna run dev server
Comment #34
andypost#33.5 Maybe option
--listen
with host (default to localhost) and port (8080 default) may pipe dev server commandPS: That could a good path to https://github.com/php-pm/php-pm-drupal
Comment #35
andypostbtw SF using https://github.com/symfony/symfony-installer/blob/master/symfony to check requirements and start server installer(demo)
Comment #36
andypostI bet it fails because you bind/listen the same port (on 0.0.0.0) so webserver can't start cos port already used by other process
Comment #37
dawehnerThis is what this patch is doing right now. I updated the issue summary.
Yes indeed, the start command is using that internally.
Right now the idea is: Let's generate an open port automatically. Because this command is not designed for any production usecase, knowing the port upfront isn't needed? (Maybe there are good other usecases though, do you mind giving some)
Please keep in mind, this command is intended for local development / trying out. It is not meant for anything near production.
Comment #38
Chi CreditAttribution: Chi commented@dawehner, tt's pretty common case using something different form
localhost
on local machine, especially with Docker based environment.Comment #39
dawehner@Chi
Mh, well, at least in my thinking, when you are in a docker based setup, you have the level of knowledge to setup a webserver as well? I don't want to argue that we shouldn't add it in the future, I just want to focus on one particular usecase in this issue. I also don't think we should block the work on #2242947: Integrate Symfony Console component to natively support command line operations. Internal refactoring is something we can always do later.
Comment #40
mglamanWhat fails? This is how you find an available port in PHP to bind to. See #30 where I run the command twice and receive ports that do not collide.
Comment #41
mglamanThis boots the builtin server. I think we can punt that to avoid scope bloat. The fac remains this gives new users a one time command to run that mimcs `npm start`
Comment #42
mglamanWhat if we just followed install.php
If there is a settings.php and a default connection defined, require forced install.
Comment #43
jmolivas CreditAttribution: jmolivas commented@kenorb DrupalConsole provides a similar command named quick:start
Actually, this command is something we called a chain command
A chain command is a custom command that helps you automate multiple command execution, allowing you to define and read an external YAML file containing the definition name, options, and arguments of multiple commands and execute that list based on the sequence defined in the file.
DrupalConsole documentation about chain commands => https://docs.drupalconsole.com/en/chains/what-is-a-chain-command.html
YAML code is here:
https://github.com/hechoendrupal/drupal-console-core/blob/master/config/...
The previous definition will execute several commands, in this case, commands that will download and install Drupal using SQLite, and finally start the PHP's built-in server.
Comment #44
dawehnerComment #45
borisson_Comment #46
mglamanI have an incoming patch to change the default behavior to
N
otherwise the dev script runs kind of weird. Also to highlight the default option and simplify install check.EDIT: This is why to change default
Comment #47
mglamanHere is the patch which changes the default confirmation answer so there isn't a reinstall when executing dev-start.
Executing
composer run-script dev-start
is like runningnpm start
on a JavaScript project. You get an installed and running environment with minimal work. There should not be any need to configure the host or specify the port. The goal is to one and done get an evaluation up and running.Comment #48
Chi CreditAttribution: Chi commented@mglaman can you check #26, some of this notes are not addressed yet. Also #12.
Comment #49
mglamanSorry, missed those Chi.
Needs check to ensure CLI.
Comment #50
mglamanThis addresses items in #12 and #26 (latter to best I could find remaining items.)
Comment #51
dawehnerAre you sure this is the right way? I'd like to be able to install into an empty database
Comment #52
mglamanWhat are the chances the database would be empty if there data connection string was available? That's the check that core does on its install (at least from what I could see in install_begin_request.) The session table is a fair signal, but this can be a bit safer in case the database is that bad (has sessions table, but not others.)
EDIT: You can still install on an empty database, you just need to force.
Comment #53
Chi CreditAttribution: Chi commentedNote that per #28 the object type hint was chosen intentionally. Personally, I cannot think of any use case with different autoloader in this command. So I would prefer using full class name for type hinting. Same type is used in upcoming patch in #2242947: Integrate Symfony Console component to natively support command line operations.
However, in either case we should use only one type hint across this file for the purpose of consistency. Currently both of them are used.
Comment #54
mglamanI also found something else while using this for a Drupal Commerce demo. When my example profile had Bootstrap it exploded.
Adding
define('MAINTENANCE_MODE', 'install');
fixed it. We're currently not defining the maintenance mode, as expected on install, toinstall
Comment #55
dawehnerWorking on tests right now.
Comment #56
dawehnerThis is a start to write some tests.
Comment #57
alexpottJust cleaning up the whitespace errors in patch so it applies clean.
Comment #58
alexpottHmmm I need a version of this patch with no root composer changes. Ignore this patch.
Comment #59
alexpottthis should be
"dev-site": "@php docroot/core/scripts/dev-site.php install && @php docroot/core/scripts/dev-site.php start",
Comment #60
alexpottHmmm... actually this works:
Comment #61
danquah CreditAttribution: danquah at Reload commentedTwo quick questions (and I apologise if I've missed the answer for them in the comments)
1: core/scripts/dev-site.php seems to need to be executable before composer run-script will execute it. Is making it executable something that happens during a build of core prior to distribution or is it something that should be done as a part of this patch?
2: I can't see that the comment regarding setting a username and password in #11 was actually address, is it work that needs doing? (I'd be happy to pitch in)
Comment #62
danquah CreditAttribution: danquah at Reload commentedOk, I should obviously have read the #60 with regards to my first question :)
As penance I've verified that the approach does indeed work - dev-site.php does not need to be executable if we run it using @php
Patch and interdiff attached.
Comment #63
dawehnerNice, I had no idea this existed. Thank you @danquah for the patch!
Comment #64
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedComment #65
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedShould this be 127.0.0.1 to match that we bind to localhost below? Otherwise, could we be grabbing an available port on the wrong interface?
Comment #11 is visible for me - if not, it notes that there's no way to actually log in to the installed site. Rather than showing a user name and password, we could print a one-time login with the destination set to
<front>
?I also got the following exception after leaving the server open for a few minutes:
Comment #66
mglamanEverything I've read, and when using this, says to bind to
0.0.0.0
which is your host.I tried looking at #11 but don't see where it says there is no way to log in. It spits out the
localpost:PORT
. However, I do notice see we do not mention the username and password. I feel like generating a one-time login link just adds more scope bloat. I'd rather just print the credentials.Ditto. I don't know how we can work around this. You'd have to call Composer with its timeout flag. See the following
Comment #67
dawehnerOh yeah, let's fix that in the composer.json!
This now also prints out a one-time login link.
Comment #68
mglamanNice! I eat my words about login link. That was much simpler than I thought.
Comment #69
alexpottThis looks a bit dodgy :)
Comment #70
webchickHm. Not sure why this is in the ideas queue. :)
Also bumping to "major" since it's a blocker for JS testing.
Comment #71
Chi CreditAttribution: Chi commentedThis change needs to be applied to the DevStartCommand as well.
Comment #72
dsnopekI think trying to bind to a port on 0.0.0.0 will fail if any interface on the server is using that port. So, this shouldn't end up in a situation where
getAvailablePort()
gives a port that's not actually available on 127.0.0.1. If anything, it'll skip ports that are available on 127.0.0.1 if they are used on other interfaces, which shouldn't cause any problems.Comment #73
andypostHey why IPv4 only? There's IPv6 so this indeed should be compatible with it.
PHP did fix that in https://bugs.php.net/bug.php?id=68420
There's total mess in interfaces & hostnames
Comment #74
dsnopekI mean, we're talking about something that's ultimately listening on localhost. Do you really need to connect to localhost over IPv6? Sure, I guess this means that the available port checking is not including the IPv6 interfaces, but we really only care about is the available ports on localhost.
Comment #75
mglamanThis is meant to be a quick start command. We do not need to worry about IPv6 or IPv4.
On the docs: http://php.net/manual/en/function.socket-getsockname.php. Port is handled by reference to be updated to the actual port it ended up binding to. As mentioned in https://www.drupal.org/project/drupal/issues/2911319#comment-12490747 I have used this to run 30-40 concurrent user load tests using ChromeDriver on random ports.
Per #73 what is the problem?
localhost
maps to127.0.0.1
which is where the port binds.This seems to be a concern by many, but not reproduced in error or steps to reproduce. I have been using that line for quite a while, which is why I suggested it.
The scope of the command is to just provide a quick development server and SQLite install for a demo purpose.
Comment #76
dawehner@andypost @dsnopek @deviantintegral
Can someone of you make a suggest what we do otherwise? I would love the functionality to find an open port automatically as it improves the user experience.
Comment #77
dsnopekRE: @mglaman in #75, I think you're misunderstanding what I was trying to say, and I guess, I probably said it poorly. :-)
I was trying to say that the code in
getAvailablePort()
would fail to bind on any already in use port on any interface, ie. it would find a port that was free across any interface (well, any IPv4 one ;-)) on the machine. So, just that that code is being extra paranoid, and so wouldn't cause problems with the fact that in the end the server is being run on localhost.I think we could change
getAvailablePort()
to just check '127.0.0.1' rather than '0.0.0.0' which would only look for a port that was free specifically on localhost, but what's the point? The current code is more paranoid than necessary, not less, so that discrepancy shouldn't cause any problems. That's the point I was trying to make.As stated above in #72 and #74, I think what the code is currently doing is fine.
EDIT: Actually, to try and clarify even more: when I'm writing above (and in #72) that it will "fail to bind" I'm referring specifically to the
socket_bind()
call in this code in the patch:So, I'm not referring to ultimately running the server failing or anything like that. Just that the
socket_bind()
above would not succeed if it were trying a port that was in use on any IPv4 interface.Whew. Writing words is hard. :-) Sorry for not being clear the first time around!
Comment #78
dawehnerComment #79
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedJust wanted to add notes on how to test the current patch quickly in a fresh environment (with no Drupal or anything else), for my (and others?) reference:
git clone --branch 8.6.x https://git.drupal.org/project/drupal.git && cd drupal
wget -q -O - https://www.drupal.org/files/issues/2911319-67.patch | git apply -
composer install
composer dev-site
One minor nit from a UX perspective: What if we make the entire login URL copy-pasteable? So instead of a new user having to realize they copy out the localhost:XXXXX part, then copy the user login path, then merge the two together to get logged in, they can just copy out the full URL and get logged in immediately?
Or provide both, but the login URL prefixed with the http://localhost:XXXXX part, just to make it easier to do the copy/paste. OR, final suggestion would be to do what Drush does and just provide a random admin password, e.g.:
Comment #80
scotty CreditAttribution: scotty commentedAt beginners sprint at midcamp, working on issue.
Comment #81
scotty CreditAttribution: scotty commentedWe found a typo in the wget patch URL in #79. It is missing "/issues" after "files". Resummarizing, the instructions should read:
git clone --branch 8.6.x https://git.drupal.org/project/drupal.git && cd drupal
wget -q -O - https://www.drupal.org/files/issues/2911319-67.patch | git apply -
composer install
composer dev-site
Comment #82
ressa CreditAttribution: ressa at Ardea commented@scotty: It looks like "/issues" after "files" wasn't added in the correction :-)
Comment #83
scotty CreditAttribution: scotty commentedThanks, just edited my comment :)
Comment #84
droffats CreditAttribution: droffats as a volunteer commentedNotes: From Mid-camp.
OSX doesn't come with wget out of the box. Had to install Homebrew and use it to install wget.
Upon running composer install we got a number of OpenSSL failures. For instance:
So the files do download from cache, but it looks like it's failing but it does actually download and install... It would be good to re-run the test from a clean install of OSX.
Comment #85
droffats CreditAttribution: droffats commentedNotes: From Mid-camp.
The site does install and run.
Comment #86
stpaultim CreditAttribution: stpaultim as a volunteer commentedI just updated to PHP 7.1 on my Mac running OSX 10.12.6 and ran through the instructions for testing.
I had some problem with the wget, but once I downloaded and applied the patch, it worked as expected.
It created and installed a version of Drupal 8 and I was able to access the site with the provided URL, login with the supplied temporary login, and edit a node.
I am working with @scotty, @droffats, and @ex DJ at MidCamp2018!
Comment #87
mradcliffe@droffats, @scotty, @ex DJ
I think the next steps are
1. Update the issue summary (How to test) to include the steps that @scotty posted in #81 with any additional gotchas in #85.
2. The issue summary has a remaining task of ensuring that the dev-site composer script doesn't "kill" an existing database. So what that means is that you should install Drupal 8 through the usual install.php process on your local environments MySQL and SQLite. Then run composer dev-site and ensure that you are still able to access the original site you installed.
3. Finally the patch in #67 needs instructions for users in INSTALL.txt. So the patch needs to be modified and re-uploaded. Ensure that you create an interdiff of your patch with #67 if you are doing this.
Comment #88
mradcliffeSetting to needs work for Documentation changes needed in INSTALL.txt.
Comment #89
droffats CreditAttribution: droffats commentedComment #90
droffats CreditAttribution: droffats commentedI edited the installed drupal site, Then re-ran
composer dev-site
and confirmed that it did not over-write the existing .sqlite db.
Comment #91
ex DJ CreditAttribution: ex DJ commentedNotes from MidCamp.
It might be helpful to add a comment to the instructions, noting what kind of Drupal user should be using this command; i.e., intended as a quick way to get Drupal running for a basic introduction, not for serious developers.
With @droffats, @scotty, and a BIG assist from @stpaultim and @mradcliffe
Comment #92
mradcliffeComment #93
ressa CreditAttribution: ressa at Ardea commentedThanks to everybody, great work! I went through these steps for Ubuntu 16.04 to be able to install Drupal 8 with the steps outlined in #81:
Install Git and required PHP packages, and check it went well
Download, move and check if Composer is installed correctly
Comment #94
mglamanWhy would we need to change INSTALL.txt? This command is for evaluation and not a legitimate installation setup.
Comment #95
mradcliffeThe issue summary says that the plan for this issue has the following, @mglaman:
> Communicate that as the simplest way to try out Drupal on your system by adding documentation to INSTALL.txt
Original issue as reported by @dawehner had "Communicate that as the simplest way to try out Drupal on your system" in the Detailed plan section. @alexpott added that requirement in #9 saying that we should add this to core documentation and changed the issue summary to add INSTALL.txt.
Is that still relevant?
Edit: for grammar.
Comment #96
karolus CreditAttribution: karolus as a volunteer commentedKnow it may be a tall order, but something along the lines of Dev Desktop is a good onboarding method for non-developers to get acquainted with Drupal. It's easy for experienced people to forget how intimidating the command line and associated processes can be for some.
It's part of the reason Drupal has had problems expanding into creative fields, where people there tend to gravitate to WordPress for apparent ease-of-use.
Yes, a packaged launch/install method may not be the best for launching industrial-strength projects, but is a quick way to people to spin up an install to try things out.
Comment #97
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedLook at the node.js community; everyone there uses
npm
on the command line to at least install/start/stop a project. I don't think it's too much to ask someone to run a few CLI commands in 2018, especially if this way they don't need an extra bunch of software (Apache and MySQL) installed on their computer.Comment #98
karolus CreditAttribution: karolus as a volunteer commented@geerlinguy, true, but that's making some assumptions about users--1) their system doesn't have older/conflicting installs, and 2) they're comfortable with the CLI. Having helped out onboard users onto Drupal over the years, I've seen some pretty head-scratching issues, which can require some in-depth problem solving and fixing to get a stack stood up.
Matthew Grasmick had recently posted on this. Some of the casual/non-technical evaluators may be the ones making the business decision of whether to go Drupal or not. It can look pretty simple for someone with technical chops, even if snags are hit--again, this is where past experience helps ease the troubleshooting.
Even for non-code projects, like a data-analytics app I'm working on--ease of use is a critical consideration in a competitive market.
Comment #99
ressa CreditAttribution: ressa at Ardea commented@karolus: I couldn't agree more, and that's why I posted the commands required to get Ubuntu 16.04 ready for Drupal 8 single command installation in #93.
Perhaps someone could check if the commands work for Mac as well, or they need tweaking?
I am now so comfortable with the CLI that I can wipe my machine for everything PHP- and Composer-related, and reinstall the necessary programs, just to see what the bare minimum is. The newbie-me would have taken forever to just get to the point where I could actually run the single commands which installs Drupal, or might never have gotten that far.
Let's help non-developers get acquainted with Drupal, as much as we possibly can.
Comment #100
quietone CreditAttribution: quietone at Acro Commerce commentedReally nice to see the progress here and thank you to everyone.
However, I don't see an un-install option. Am I missing it or is that not a consideration?
Comment #101
dawehnerDo you mind opening up a new issue for that? I think its worth discussing but I don't think we need this option right from the start.
@ressa
You could massively simplify this by using lamp-server and maybe the downloaded package.
Comment #102
ressa CreditAttribution: ressa at Ardea commented@dawehner
Ubuntu should be ready for single command install with three lines:
That is a fairly short process, but if your suggested lamp-server solution is faster and easier to set up, we should of course use that, if it reduces the barrier of introduction to Drupal.
Would you care to share the steps involved?
I don't want to pollute this issue with irrelevant discussions, but I feel that getting a new Drupal user ready to actually send off the single command which installs Drupal is as important as the single command solution being built here.
Comment #103
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedI'm just saying that no matter what option we choose, there will be head-scratching issues. At MidCamp last week, I was trying to help someone on a Windows laptop figure out why a fresh install of ADD2 on a new Windows 10 Pro machine had an error message while adding a Drupal site that a zip file couldn't be expanded. After 10 minutes neither of us could figure it out (and I had to run to a session :( ).
At least if we use PHP (and maybe Composer) we limit the amount of dependencies and permissions required to almost bare minimum :)
My ultimate end goal (not saying this is "Drupal.org's end goal", just mine) is that we have something akin to a "quick start guide" for Drupal, and it's literally:
Which this issue achieves pretty handily. Again, comparing more to Node.js, Go, Python, Symfony, Laravel, etc. communities, this is super standard. I don't know if we want to compare Drupal to Wordpress anymore—we jumped the shark to using Composer, giant dependency trees, modern PHP etc., and we live with that (or own it).
Comment #104
dawehnerYeah! I hope we do indeed achieve the same. I guess instead of telling people to run composer we could also point them to a dedicated file running the two commands.
I think we cannot do that right now until we aren't down the the three steps layed out by @geerlingguy. Does this make sense?
Comment #109
mradcliffeThat makes sense. I noticed that the biggest difficulty for getting this setup wasn't the patch or the composer command, but 1) applying the patch (getting a wget/curl with OpenSSL support) and 2) getting the prerequisites installed (PHP and Composer).
But I also just noticed the test fail in #67 too so it's NW anyway. :*(
Comment #110
heddnre #109: I personally prefer to use wget myself, but curl is much more universally available. Curl is a requirement for PHP and Drupal. So perhaps we should write any instructions with that in mind and use curl in future examples.
Comment #111
dawehnerGetting the tests running is a bit challening. Here is some intermediate progress on it.
Comment #112
yoroy CreditAttribution: yoroy at Roy Scholten commented@dawehner wondered if this needed product manager feedback. Not sure, but this is an outstanding idea of course :)
I see this pattern of "3 commands in the terminal to running X" everywhere as well and it would be great to provide the same for Drupal. Great in the sense of catching up with the rest of the world but more importantly as something that would enable us to clean up and focus our onboarding materials (guides, documentation etc).
This is great. Would be good to make any necessary decisions with this perspecitive in mind.
Comment #113
mradcliffeI think it's okay that PHP + composer is a requirement before the 3 commands as that is the same exact situation as Node.js. You need node.js to run npm projects. It's sad that PHP doesn't have a native packaging utility bundled like node.js, but that used to be the case with node.js a few years ago. I don't think that getting PHP + composer should be considered one of the 3 commands in that case.
Also composer install is only necessary when testing this issue because the intended use case is someone downloads a Drupal 8.6.0 release, then they can run
composer dev-site
directly, which saves one step. :-)So
A. Get and install PHP.
B. Get and install Composer.
1. Download Drupal 8.6.0
2. Extract drupal-8.6.0
3. Open terminal
4. Change directory to drupal-8.6.0
5. composer dev-site
6. Copy URL.
6. Open web browser and paste URL into address bar.
That's 2 commands (cd and composer) in the terminal.
Edit: the following is probably too much bike shedding. Sorry.
Could we write output after this to mention that the command succeeded? That was also confusing when we were testing. We didn't think it was "done" or ready and that the command had stalled out so we killed the process.
On my linux desktop that droplet isn't going to render (and maybe not on Windows either), but emojis are friendly, right?.
And maybe this could be done so that the Login using is printed after the web server is started? I know that install/start are distinct, but is there ever a reason not to generate a one-time login URL during start if I'm evaluating or trying to get started quickly? I think I would want to be in the administration UI to start exploring or making content right away.
Also to consider, angular cli, drush and webpack dev servers can start a browser on some devices. I personally find this annoying, but others find it useful and it would eliminate the final step of navigating / copying and pasting the URL into the browser.
Comment #114
MixologicComposer has this built into it too:
composer browse drupal/examples
takes you to the cgit repo andcomposer browse -H drupal/examples
takes you to the project page in your system configured browser.Seems relatively simple to do: https://github.com/composer/composer/blob/685ff8699ba378cc815849fb7daa8d...
Comment #115
quietone CreditAttribution: quietone at Acro Commerce commentedAdded followup to create an uninstall command as suggested in #101. #2953810: Provide a single command to un-install after installing with single command
Comment #116
dawehnerI added support for opening up the one time login URL in the browser automatically.
Comment #117
cashwilliams CreditAttribution: cashwilliams at Acquia commentedTesting with #116 -
Browser does open with one time login link.
However, I get WSOD on quite a few pages, such as /, /admin/content, /admin/reports/dblog. This could be 8.6 issue, or an issue with this patch, not sure.
Debugging this isn't easy as no logs are printed to the screen after the server is started. Would it be possible to have logging output the same way `drush run-server` does?
Comment #118
cashwilliams CreditAttribution: cashwilliams at Acquia commentedI tested same patch applied code base and it seems to be a problem with 8.6, not this patch. So marking this back for review.
However, just to show my point for consideration -
dev-site output while getting WSOD pages:
drush run-server output while getting WSOD pages:
Comment #119
dawehner@cashwilliams
Do you think adding logs could be added in a follow up? There are so many things we could do :) I prefer though to get something done, and then iterating on top of that.
Comment #120
alexpottPatch attached fixes the dev start command so that the webserver is started before the browser opens (and also outputs all the output from
php -s
as per #118 because I was mucking around with the process object).It also automatically logs the user in to save a button click.
It also removes the global composer timeout setting in favour of something specific for the dev-site command.
It also does a couple of coding standards cleanups.
Comment #121
heddnHere's a hack at the INSTALL.txt docs. It was the minimum instructions that still used Curl. It defaulted to using unzip as that is more readily available on Windows.
I also changed the install message. It was a bit jarring to just see a "wait" message without any expectation what would happen next.
That should mean this can be reviewed for its final time as all the key points in the IS are now covered.
Comment #122
alexpottHere's a patch with a test that works. After implementing the test I'm wondering if we can't share a lot of core with #2926633: Provide a script to install a Drupal testsite since that install command seems to be a very special case of what we're implementing here.
Comment #124
alexpottHmmm that test passes locally. Let's see if we can work out what is going on on the bot.
Comment #126
dawehnerOh I see :) This makes sense.
Can we link to composer, in case someone doesn't know what it is?
Can we document windows somehow here too?
Maybe we could drop a little comment like "Read more about running Drupal in the next sections".
Nitpick, this is an array, isn't it?
Comment #127
alexpottFixing test coverage and addressing #126 - apart from #126.2 - I have no idea about Windows unzip documentation.
Comment #128
alexpottThe last interdiff was wrong it should have been.
Comment #129
alexpottWe don't need so much change to install_begin_request() - the additional parameter is unnecessary.
Comment #130
alexpottFor reviewers, these are the changes to the installer to support the new command. They really exist only for testing so that we can install to a path other than sites/default.
In reality these command options are only really for testing the commands so I think we need to update the docs. And they wouldn't actually work. If we want a user to be able to do this then we need to change \Drupal\Core\DrupalKernel::findSitePath() to allow us to determine the site path from an environmental variable.
Comment #131
alexpottPatch attached removes the
site_path
option since it is not going to work for regular users without changes toDrupalKernel::findSitePath()
. Instead we use an environment variableDRUPAL_DEV_SITE_PATH
to make the commands testable. We can open a followup to use this same variable inDrupalKernel::findSitePath()
and then we could add the options back. This would be neat as you could then demo two sites at the same time (perhaps a before and after).Comment #132
kenorb CreditAttribution: kenorb commentedThe following line in
core/INSTALL.txt
is showing some weird characters.Comment #133
alexpott@kenorb that's a unicode ellipsis... what are you seeing in
\Drupal\Core\Asset\CssCollectionOptimizer::optimize()
there's a comment in there that uses exactly the same character. We use it all over the place.Comment #134
dawehnerThis sadly makes it impossible for composer scripts (like post-install-cmd to add bits to the settings.php).
Comment #135
alexpottPatch addresses #134. Also I tried to test the --force option and it just didn't work cleanly. In order to actually delete the sqlite db and to properly re-install you have to delete the entire files directory. So rather than do all of this here I think we should just tell people that the site is installed already and be done. For me that's all that is necessary for a viable patch. If people need a way to re-install a site then we can work on that in followups.
Added test coverage of trying install over the top of an existing site.
Comment #136
alexpottWith #135 when running the
composer run-script dev-site
I see:I think this looks good and is working as expected. The one thing that would be nice is if the composer command passed the arguments on the install command so you could select the profile. Or maybe if there was no profile argument it asked.
Comment #137
alexpottComposer doesn't allow us to interact with the user https://github.com/composer/composer/issues/5856 :(
I'm not sure we should provide a composer command.
Comment #138
dawehnerDo you think it would be still helpful to run both after each other, without requiring people to know the intermediate steps?
Comment #139
alexpott@dawehner totally! One thing I was thinking about is are the two commands actually necessary and whether dev-site was the right name. I think a single quick-start command might be a good idea. This command would install (if necessary) and start up the PHP web server.
Comment #140
dawehner@alexpott
Well, I'd like to be able to install modules / do other bits like services.yml changes before starting up Drupal.
Comment #141
phenaproximaI really dig this patch, man. I sense much win within, and couldn't find any serious problems. Only random questions and nits.
"Wait" is followed by a smart ellipsis. Can it be three periods instead?
Why is this separated in a list item? It seems like it could come right after "...take a minute or two."
Nit: I think we could shorten the line by using the ?: construction.
The descriptions should probably end with periods.
This should say what the default value will be.
It seems to me that we should allow a user to specify a database URL, in case they don't have SQLite or don't want to use it. But we should continue to default to SQLite. Maybe that's more follow-up material, though.
Also, the error message could be more helpful. Maybe it could include a URL on php.net explaining how to install the extension?
is_dir() might be preferable here.
We should probably throw exceptions and fail if copy() or mkdir() fail.
Nit: This could be collapsed to a single line.
Shouldn't the option names have dashes, not underscores?
Nit: 'drupal' should be 'Drupal'.
I"m not sure we need this, because the method itself does not throw any exceptions.
Is there anything here that might fail? If so, how should we handle those failures?
'opens' should be 'Opens', and 'url' should be 'URL'.
s/brower/browse
Never seen this kind of thing before. What will it return?
Nit: Can these variables be prefixed with is_?
We're assuming the server name is localhost. 127.0.0.1 might be safer here. Even better, it'd be cool if the server name could be passed in as a command option.
This error message is superfluous because openBrowser() will echo out a useful error message if the browser cannot be opened.
This logic seems strange. What will find() return if it fails? If it's false, won't $binary automatically fail the check, and cause the exception?
Nit: Could be collapsed into a single line.
Shouldn't the version be 8.6.x, or \Drupal::VERSION?
Comment #142
dawehnerWait ..… isn't hte smart ellipsis used exactly for this usecase?
Good point
Note: This doesn't work when the array key isn't set.
Done
Done
I opened up a follow up: https://www.drupal.org/project/drupal/issues/2955344
Done
Done
done
Great point!
Done
Sure, but it still throws an exception, so it might be worth catching. ¯\_(ツ)_/¯
Sure, let's do that
Done
Done
There is no need for that :)
Sure
What about allowing this in a follow up?
Are you sure? What happens when running xdg-open/open fails?
Well, otherwise, $binary wouldn't be defined ...
Sure
Comment #143
dawehnerForgot to also upload a no-composer file.
Comment #144
mradcliffeI think the first two commands need additional review. Maybe in a follow-up?
Let's say I'm a new user. I go to drupal.org. I click "Download & Extend". I click "Download .zip". I find the downloaded file and double-click it to extract it (works on Windows and MacOS). I read INSTALL.txt. Do I need to run curl, unzip and cd again?
My next step is to open a command prompt (Terminal.app, PowerShell, Git Bash, Cmd or Terminal/xterm/aterm/iterm/whatever). I think some of the more OS-specific commands are best suited for online documentation guide at https://www.drupal.org/docs/8/install rather than INSTALL.txt or even drupal.com/getdrupal.com.
Would this work?
I am not sure how to describe change directory since who knows where an user will have downloaded Drupal to. It's probably
~/Downloads
orC:\Users\username\Downloads
by default.Comment #145
mglamanThe pattern I followed in my book was always
cd /path/to/drupal-8.x.x
. Helps convey that it isn't _right_ there all the time.Comment #146
alexpottDiscussed these changes with @dawehner.
Comment #147
alexpottThe security tag was added when the script didn't do
it does now... and anyway on a well configured apache I get a 403 cause of .htaccess when I tried to access the script but the double protection is good. Also the script will not install over an existing site so that's good too.
Comment #148
alexpottInstalling the standard profile via the quick-start command was producing an error because the CommentManager service is required to generate the 1 time login link and some where in it's dependencies it required a request... so adding one to the stack fixes that.
Comment #149
phenaproximaSome of the options have underscores, and some have dashes. They should be consistent (I think dashes are preferred, since that's the standard for command-line options.) Also, some of the descriptions mention the default value, and others don't. Some end with periods, and others don't.
Seeing as how the $classLoader member is type hinted, should the $class_loader parameter be as well?
Underscores or dashes? All the commands in this patch should be consistent. Also, the descriptions should mention default values, if any, and end with periods.
I think we should rephrase this error message to be more helpful. Maybe "You must have the SQLite PHP extension installed. See https://secure.php.net/manual/en/sqlite.installation.php for instructions."
These should mention what the default values are.
mkdir() may return FALSE, we should throw an exception if it does.
Nit: Does this need a leading backslash?
This logic is a little convoluted and makes me uncomfortable. Can it be refactored into a more "traditional" form that doesn't feel as implicit/magical?
Comment #150
alexpottThanks for the review.
-
Also
server
command when there is no install and made the error that occurs when you do that more helpful.Comment #151
alexpottSo how should the profile selector work?
machine name | proper name
machine name | description
proper name | description
Not in all cases Console helps you auto-complete so that's really good. Personally I really like having the description because it tells you why you are selecting an installation profile. I also really like having the machine name because it is what you'd pass in if you want to avoid the prompt. So I've coded up option 2.
The other thing I'm pondering is if we should make the install profile an argument rather than an option - to be more like drush site-install?
Comment #152
alexpottAnd here's a patch :)
Comment #153
phenaproximaIMHO, it should be an option. Drupal's default behavior is to install Standard unless told otherwise, so the console commands should be in keeping with that. Although this is targeted at developers, I still think we can follow the "don't make me think" UX rule.
Comment #154
cashwilliams CreditAttribution: cashwilliams at Acquia commentedOn argument vs option -
I vote argument, it would just be an optional that defaults to standard.
`drush si` and `drush si standard` do the same thing.
Comment #155
heddnMachine name + Description and default to [standard]
Comment #156
Chi CreditAttribution: Chi commentedThree different ways to write error message. I propose we stick to one of them for the purpose of consistency. Also
return 1
is needed here to set the appropriate exit code.Comment #157
alexpottRe #156 Error writing standardised and return an error code. However re #156.2 as it says in the docs that is on purpose not an error so that is not changed.
Unfortunately changing install profile to an argument is not that simple because of the way we have a default command and an install command so it can't be an argument for the quick-start command. So I vote leaving as optional. The other way to go would be to change the application to be called drupal. So then we'd have:
I think I'd prefer
But then we'll have the all php files must end in .php brigade up in arms. There's also a pre-existing core/scripts/drupal.sh to get confused with.
The default is the same as the install profile select form - unfortunately this is not a simple thing to document in a command. The default if present is Standard, If that is not present then Minimal and if that is not then whatever is next. However if there is one profile that is a distribution then that overrides everything and is selected automagically. Tried to document this.
The patch attached also implements a progress bar. I couldn't resist - it was too simple a change to install_run_tasks() and install_drupal() to support this.
Also whilst testing I've noticed that installing in other languages doesn't quite work as well as one would hope. Dunno why yet. But I suspect the translation downloader was not written to be run by a non-interactive installer.
Comment #158
alexpottI think we should bring our work into line with #2242947: Integrate Symfony Console component to natively support command line operations and standardise on
core/scripts/drupal
. Here's a patch that does that and also makes the command easier to test locally - the last patch broke that because of the way the progress bar works.Also now I've made that move I've changed install profile to an argument.
Comment #159
Chi CreditAttribution: Chi commented@alexpott, should we add this command to composer scripts?
Comment #160
cilefen CreditAttribution: cilefen at Institute for Advanced Study commentedOr core/bin/drupal? FWIW that would be more Composer standard.
Comment #161
phenaproxima+1 for this.
Comment #162
Chi CreditAttribution: Chi commentedWe could specify
bin
key in composer.json file. See #2242947: Integrate Symfony Console component to natively support command line operations(#89 and #91) for details.Comment #163
pingwin4egIf we name it
drupal
and put it in thebin
, wouldn't that clash with the drupal/console project?Comment #164
alexpott@pingwin4eg I think not. I think that console typically goes in vendor/bin but yes there would be a clash if we tell composer to treat core/bin/drupal the same and when installing a Drupal project put core/bin/drupal in vendor/bin. But there is certainly a naming clash :) I think it is ironic that #2242947: Integrate Symfony Console component to natively support command line operations is using the
console
name anddrupal/console
is usingdrupal
name. Anyhows.I really don't know what to do with core/scripts/drupal vs core/bin/drupal. I feel that
drupal
is the right name for the command especially given we want to expand the scope of what a core provided cli can do. Part of me thinks core/scripts is simpler because that's where all the scripts are now and another part thinks core/bin is obviously more in-tune with everything else. Though thinking about my recent experience with craft they just have it in the doc root which has a certain amount of allure - thinkphp drupal quick-start</core> or even <code>./drupal quick-start
if drupal is executable. However going for the root directory will be difficult for sites created with composer create-project - at least another level of complexity. So.... my gut feeling says let's punt on this in this issue. We can always move it fromcore/scripts/drupal
later in #2242947: Integrate Symfony Console component to natively support command line operations and just leave behind a deprecated version that just includes the new version.With respect to putting the command into composer.json so it can be run with
composer run-script
that does not work. Composer is not a very good script runner at the moment because it does not allow user input. See #137 for more details. Another reason not to do that is that it introduces a completely unnecessary dependency and the less of them the better.Comment #165
alexpottUpdated issue summary with the current state.
Comment #166
alexpottSo multi-lingual install works via CLI if \Drupal::VERSION is equal to 8.6.0 but not when it is equal to 8.6.0-dev :)
And picking through the interactions of
Is not at all simple!
Comment #167
alexpottPatch attached fixes multi-lingual install. It also fixes multi-lingual install for Drush on development versions of Drupal too :)
I think we probably should carve these changes of into a blocking issue for more focused discussion on them. They are however very very small :)
Comment #168
Mile23If we put it in
core/scripts
orcore/bin
or whatever, then we can tell people to runcore/scripts/drupal
in documentation, and it will work alongside drupal/console by accident. It will be confusing, because it will be similar to documentation for drupal/console, but it will be workable.If we tell
composer.json
thatcore/scripts/drupal
is a vendor binary, then there will be a couple problems. https://getcomposer.org/doc/articles/vendor-binaries.md1) It will conflict with the drupal console project, since they both have the same filename.
2) The script might need to account for being run from an arbitrary place in the filesystem (since the user can require drupal/core globally, and since they can also say
config:bin-dir:literally/any/where
).So, Option A: If we think we might at some point turn this limited-scope script into a full console tool, we should either ask drupal/console to change their name (not very nice), or use a different name for this script. To this end, if we're planning to expand from here, I'd endorse adding this script to
drupal/core/composer.json:bin
, so that we address this problem now instead of not.What we actually call it doesn't matter that much as long as it doesn't conflict. #2242947: Integrate Symfony Console component to natively support command line operations calls it
console
, which is hopelessly generic and might conflict some other way eventually.Option B: We could not hinge this on future expansion. We could just call it
drupal-installer
because that's what it does. Any future console integration could happen separately and simply involve adding the happily-factored command objects from this script to the console app for the other one. Naming itdrupal-installer
avoids the documentation confusion, and allows us to leave that script in place even after we add whatever other general-purpose app we make.Comment #169
alexpottHey look at what is possible now!
I guess now I need to work asking the select profile question once that is translatable. As we now have the callback in the install system that should be possible.
@Mile23 well the aim of #2242947: Integrate Symfony Console component to natively support command line operations is to build a generic Drupal CLI provided by core so in my mind it is that issues job to sort out the clash with drupal/console and ponder the composer bin questions. All we should do here is worry about what we are telling people to do here and unfortunately
drupal-installer quick-start
does not make sense. Also yes it is not nice but Drupal is this projects name and console calling their command drupal is actually the clashing thing - there already was core/scripts/drupal.sh and has been for years. There's no way around it that the obvious name for a drupal cli tool provided by core is drupal - it's what anyone would expect.We have 3 commands here:
quick-start
,install
andserver
. They are all doing things with drupal hence core/scripts/drupal. I'd vote for leaving it at that and solving the bigger issues in #2242947: Integrate Symfony Console component to natively support command line operations.Comment #171
dawehnerLet's remove drupal.sh, honestly, I doubt anyone is using it: #2955805: Remove drupal.sh
Here are a couple of nitpick/small changes.
I'm curious whether console could rename itself on the longrun to console? On the other hand II actually believe that they have similar commands already, so maybe the right solution is for them to reimplement our new commands with the same interface.
Comment #172
ressa CreditAttribution: ressa at Ardea commentedThis is fantastic, great work so far everyone. Here are updated instructions for testing the current patch quickly in a fresh environment:
Ensure you have PHP 5.5.9 (or greater) installed, and run these commands:
A fresh Drupal installation will now have opened up in your browser, logged in as administrator.
Comment #174
Mile23Woot!
We also have #1540390: Deprecate the drupal.sh script and #2289405-21: [META] Port all shell scripts to console commands where @andypost argues that porting existing scripts is more purposeful than simply doing an integration framework.
I think we're at a sort of critical mass where this stuff should happen in a structured way.
Comment #176
alexpottFiled #2955869: Fix multilingual install on Drupal dev version for CLI utilities which we are now blocked on.
Comment #177
dawehnerI added some steps contributors could do and would be really valueable.
Comment #178
kim.pepperAwesome! So happy to see this issue moving along.
We need to handle invalid profile names. My first attempt was:
Comment #179
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedI'm going to definitely do the
Try it out on windows
task. I knew lugging my ThinkPad to DrupalCon would be helpful in some way or another :)Not sure if PHP or Windows 10 Pro itself comes with SQLite available, but I'm going to follow my own guide for installing native PHP/Composer on Windows, and then run through testing this patch and see what happens. Fingers crossed.
Comment #180
alexpott@kim.pepper can we get some info on your system? How did you get the code, what OS, PHP version etc...
Comment #181
Mile23Re #180: The profile is called demo_umami, not umami. So we have to figure out if the profile exists or not before acting on it.
Comment #182
MrMason CreditAttribution: MrMason as a volunteer and at Sealed Air commentedI am going to give the video of this working a try. I'm not sure if it's at a point where we can do this but I have a mac and all the software to record this. I'm going to run this fresh and report back if I am going to be able to get this flowing properly to record it.
Comment #183
kim.pepper@alexpott Yep sure:
Comment #184
alexpott@kim.pepper did #181 fix it for you?
Comment #185
larowlanFrom #178
i.e we should recover gracefully if the profile does not exist.
Comment #186
dawehnerThank you @geerlingguy and @MrManson
Feel free to find me in slack/drupalcon, when you need help/want to chat.
Sure, I'm having a look at that!
Comment #187
kim.pepper@alexpott Like @larowlan said, I was merely pointing out there is a stacktrace if you pass it an invalid profile name. We should just return a message like "invalid profile name".
Comment #188
alexpottHere's a fix for the invalid profile name issue. Also provides a suggestion if you get it slightly wrong.
@kim.pepper - i totally missed
. Sorry. Nice find.
Comment #189
alexpottSorry @dawehner I didn't see you had assigned yourself.
Comment #190
kim.pepperAwesome work @alexpott with the suggestions. Today I learnt a new php function: 'levenshtein'
Comment #191
alexpottThe blocker has been merged. Rerolled. Multi-lingual install will work!
Comment #193
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedWindows steps:
username\Sites
) where you want to clone Drupal.git clone --branch 8.6.x https://git.drupal.org/project/drupal.git drupal8
cd
into the Drupal folder:cd drupal8
(I love how PowerShell aliases the posix-y commands nowadays :).Invoke-webrequest -URI "https://www.drupal.org/files/issues/2018-04-12/2911319-2-216.patch" -OutFile 2911319-2-216.patch
git apply -v 2911319-2-216.patch
composer install
php core/scripts/drupal quick-start demo_umami
(If you get an error in the patch download, run
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
to make sure PowerShell can interact with Drupal.org's HTTPS).Almost everything worked, but it looks likeIt looks like I was missing thesocket_create()
was the one fatal flaw... output fromquick-start
command:Call to undefined function Drupal\Core\Command\socket_create()
php_sockets.dll
extension in my php.ini file. Uncommented that line and now it's working!I'll post a video of the entire process in a few.
Comment #194
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedHmm, on second thought—the localhost server is started, it dumps the URL to the console, then it opens a random Windows Explorer window and quits the server and dumps me back to my current path in PowerShell. Video will show the details once I get it uploaded.
Comment #195
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedAdding tag.
Comment #196
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedAh, getting the error (masked because of the suppressed output):
Comment #197
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedChanging
localhost
to127.0.0.1
gives the following different error:Comment #198
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedHere's the video promised earlier, of testing on Windows 10 Pro of the patch in #191: https://drive.google.com/file/d/17uRiPG6iTcFIxUV_uggajm0HBM1C9I46/view?u...
Comment #199
ressa CreditAttribution: ressa at Ardea commentedThe latest patch works perfectly, failing gracefully and showing this if you try
php core/scripts/drupal quick-start umami
:Linux steps
Install Git and required PHP packages, if needed:
sudo apt-get install git php7.0 php7.0-curl php7.0-dom php7.0-gd php7.0-mbstring php7.0-sqlite3
Install Drupal Umami demo:
curl -sS https://ftp-origin.drupal.org/files/projects/drupal-8.6.x-dev.zip --output drupal-8.6.x-dev.zip
unzip drupal-8.6.x-dev.zip && rm drupal-8.6.x-dev.zip
cd drupal-8.6.x-dev
wget -q -O - https://www.drupal.org/files/issues/2018-04-11/2911319-2-191.patch | git apply -
php core/scripts/drupal quick-start demo_umami
When you are done testing, close the PHP server with
CTRL + Z
and delete the drupal-8.6.x-dev folder.Comment #200
dawehnerNice!!!
Why do we not just compute the levenstein difference and sort the result, and limit the list to two?
This comment seems wrong.
Comment #201
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedRe-tested everything in Windows 10 under the WSL in Ubuntu, and am getting different errors; the PHP webserver is started, but trying to load a page results in:
I'm attaching a screenshot of the terminal after running quick-start with no arguments (in WSL, it had an error opening the one-time login URL, presumably because the environment in WSL doesn't easily allow the script to open a Windows GUI browser), and then again with
--suppress-login --show-server-output
.I'm also attaching a text file with the full error message when trying to load a page under WSL/PHP.
Comment #202
dawehner@geerlingguy Thank you for your great testing! I'm curious, can you install via sqlite normally?
Comment #203
alexpottI'm a bit confused as to how #191 was green - running core/tests/Drupal/Tests/Core/Command/QuickStartTest.php locally showed that it was very broken. Ah I see it's the marking tests as skipped let's remove that - see what happens and then implement something better.
Patch attached fixes the tests and also changes how ports are discovered and what hostname is used by default. It also allows both to be customised. It works fine OSX. I wonder about Windows @geerlingguy?
Comment #204
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commented@dawehner - It seems like the Drupal install completes successfully (using SQLite), it's just that something fails with the hostname allocation :/
@alexpott - I'll try the new patch tonight. For my own reference, the new options are
--host
and--port
.Comment #205
dawehnerCan't we change the setting dynamically to adapt that?
Comment #206
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedMore debugging on Windows 10:
--host localhost
or--host 127.0.0.1
, I get the same errors as seen earlier.--host [IP from ipconfig]
(using either the wired or wireless physical device IP), I get the same error as with 127.0.0.1, namelyFailed to listen on 170.20.20.2:8888 (reason: ?)
.--host 0.0.0.0
, I get the same error.php -S localhost:8888
(after having used quick-start to install Drupal), the server stays up and I can browse the Drupal site in a browser.It looks like
reason: ?
is only returned when the error string is empty (see this line in the php src). Further digging and Googling is getting me nowhere. Any other ideas?Can someone else with Windows 10 test this process out and see if maybe it's just my machine? It's a pretty plain-vanilla Win 10 Pro install, no VPNs, no special software, nothing special on it... but who knows, maybe some other testing with VirtualBox or Docker could've messed up the networking internally?
It's weird though that the PHP built-in server works fine, but the Symfony component doesn't seem to do so. Maybe we're missing an option that's required to get it working? I'm going to see if I can also test with the Laravel artisan quickstart environment and see if their Symfony-based quickstart environment works here.
Comment #207
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedInterestingly, Laravel's
laravel new [appname]
command required PHP 7.1.x or later to work, so I had to upgrade my Windows native system PHP from 7.0.x to 7.1.x. (But neither 7.0 nor 7.1 made a difference when using quick-start with this patch.)After doing that, I created a new Laravel app, then ran:
php artisan serve
, and got the following:Content was served and the server kept running fine. So I wonder if it's something in our implementation?
Comment #208
alexpottSo Laravel is doing
passthru($this->serverCommand(), $status);
. Symfony usesproc_open()
which is what Drush is using too. But Drush is running the server command interactively. Looking at Drush it seems there is a way to keep the auto-logging in. So copying them but using the passthru approach of Laravel.Also patch attempts to fix the test skipping issue. We can't run this test if sites/simpletest does not exist and that is not a usual requirement for running Drupal core unit tests.
Comment #210
jonathanshawOn Windows 10 using powershell (admin) and #208 I get
But no browser opens, no error appears.
Sockets is loaded according to
php -m
.Copying and pasting the link into a browser and it works fine. Yay!
Comment #211
alexpottAdded some verbose output so we can try to work out why the browser does not open. @jonathanshaw can you add a
-v
to your command and then try the browser command from your shell. Thanks!Comment #212
jonathanshawComment #213
alexpott@jonathanshaw so what happens if in another shell you do
sleep 2 && start "web" explorer ""http://127.0.0.1:8888/user/reset/1/1523531894/7t7kP_toHPwJ2ExCx-aXr0nMwcaM-uRloYnkI_HESe4/login?destination= 2F""
whilst the server is running?Comment #214
alexpottI think we might have too many quotes for Windows. How about this?
Comment #215
jonathanshawIn powershell (admin):
#214:
#213:
with or without double quotes:
Sleep 2
is fine. As issleep 2; sleep 2
but notsleep 2 && sleep 2
.Sometimes
destination=%2F
becomesdestination= 2F
but this doesn't seem to affect what I'm reporting here.Trying start on its own:
gives
gives
Start-Process : A positional parameter cannot be found that accepts argument ''.
So double quotes is clearly not working, but it's not the only problem.
What works:
Comment #216
dawehnerComment #217
alexpottThanks for all the info @jonathanshaw. Patch attached should fix that. It also removes usage of ProcessUtils::escapeArgument() because that is deprecated. That's not being picked up by the tests because the command PHP is being run totally outside of Drupal. Tricky to know how to solve that. Should have a follow-up for that.
Comment #218
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commented@alexpott - latest patch (216) outputs:
But browser still doesn't open automatically. If I run the Browser command separately, I get:
Comment #219
jonathanshawYeah, the command needs to be
start "http...
notstart "web" explorer "http...
.Comment #220
alexpottHow about this? Moved the sleeping to PHP-land so we should be abler to work on any shell in Windows.
Comment #221
jonathanshawUggh.
start "http://...
works from powershell fine, but when run form inside the script it does nothing but open a new command prompt.I will play around with syntax inside the script and see if I get any joy.
Comment #222
jonathanshawAnd we have a winner ...
$cmd = 'start "" ' . $url;
Start requires a title (can be zero length string) as its first argument when called from inside a script.
Comment #223
alexpottHere goes... I choose to have a title vs an empty title - because empty quotes just looks weird. https://ss64.com/nt/start.html says:
Comment #224
jonathanshawYay! #223 works for me on windows 10 pro, powershell (admin), php 7.1
Comment #225
dawehnerI started to generate an admin password automatically. On top of that I simplified some things a bit.
Comment #226
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commented@alexpott - And now I've tested it on macOS High Sierra, and also under Travis CI / Linux / Ubuntu 14.04 (see automated build, and everything seems to work well!
I'm tempted to hit RTBC, but do we want to leave this issue in review so some DrupalCon sprinters tomorrow can re-test, gather screenshots, etc. for an RTBC tomorrow (and heck, maybe on-stage commit!).
Comment #227
alexpottThis change means we don't get the message in the user's chosen language. Cause
Congratulations, you installed @drupal
is text already in core. Left alone for now. Maybe we should drop the translatability and use the info tag to make the output readable.Patch attached continues the tidy-ups - fixing the borken distribution handling, and remove the defaults from the description - console adds this for us.
Comment #228
ressa CreditAttribution: ressa at Ardea commentedWith the latest patch, the browser opens up on the
/user/1/edit
page, and not front as it did previously.NOW:
http://127.0.0.1:8889/user/1/edit?pass-reset-token=DSdMFZoQlgmUwGxdHBusNqgulAM1vIo06oljzHx-ZaOp-M_Iv4p-rTI93WhpKzMRROgEcC4G1w
BEFORE:
http://localhost:39048/
I think opening front is the best user experience.
Comment #229
alexpottOkay let's add that back but we need confirmation this doesn't break windows. There were problems with this earlier. As we're not escaping user input I'm avoiding using escapeshellarg() on Windows since we know this is a generated URL.
Comment #230
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commented@alexpott - #229 still works great on Windows 10, running PowerShell as administrator or not; see attached file.
Comment #231
ressa CreditAttribution: ressa at Ardea commentedThanks for fixing it @alexpott, #229 works perfectly, opening the front page in the browser on Ubuntu 16.04.
Comment #232
larowlanIs the long term plan to move to a phar that does these steps for you?
e.g. the issue summary uses an npm example
We still have these steps.
can use a normal if here, previous if returned
Should we add some output here when running in verbose?
it's a pity SymfonyStyle doesn't expose ProgressBar::setMessage - we could provide some useful feedback here to break up the 'this could take a minute'
Upstream issue?
Worth adding some more usage examples now we have host/post/suppress?
a lot of this feels like it has use outside of this class - i.e as a generic helper class, not disimilar to things like the table, progress and question helper - should we split out? We have similar stuff in run-tests.sh that we'd eventually want to be a console command, so there is at least one other chance for re-use
similarly here - should this be a trait - there is use for it outside this test?
Comment #233
borisson_#232, I don't think we should extract things from this class to helper classes / traits for now. We can always do that in the future. Especially if we annotate the Commands with
@internal
, and I think we should do that.This variable is used only in one place as far as I can see. So we should probably remove the variable and use 2 in the place where it is used.
Comment #234
benjifisherI am adding the Novice tag for further testing, including screenshots/screencasts. There are also non-novice parts left for this issue.
Comment #235
pbirk CreditAttribution: pbirk commentedI'm working on this today at DrupalCon Nashville in the mentored sprint room. Come find me if you are, too.
Comment #236
alexpottThanks for the reviews @larowlan and @borisson_
I've fixed #232.2,3,5
I'll go and look for upstream issues re #232.4
I agree with @borisson_ we should make these
@internal
for now and look to make things generic as and when the need arises.Comment #237
alexpottRe: #232.4 I looked upstream and found that this was already possible.
Comment #238
pbirk CreditAttribution: pbirk commentedI tested against both #229 and #237 in a DrupalVM environment and it worked both times. My environment required that I update the --host option. I noticed that option when I reviewed the patch. I think a quick note in the INSTALL.txt file would make this more clear and will submit a patch for that shortly.
Comment #239
alexpott@pbirk thanks for testing! What did you need to update it to?
Comment #240
heddnIs this needed now?
Comment #241
Chelsee CreditAttribution: Chelsee as a volunteer commentedI tested this on my Windows 10 Pro Microsoft Surface in power shell. Everything seemed to work, it opened up my browser and looked good.
Comment #242
alexpottOn an English install this message doesn't really appear. It's really just to cover for downloading translations which doesn't have a 'display_name'. But I think now we have the progress bar feedback is much better and problem @heddn is correctly. That message is redundant. We added before we had the progress bar. Anyone else have any thoughts about that?
Comment #243
pbirk CreditAttribution: pbirk commented@alexpott I needed to use --host=192.168.88.88 since I'm accessing the site from the browser on the host computer, not via the VM (where I don't have a GUI).
Comment #245
pbirk CreditAttribution: pbirk commentedThis is just a quick patch that adds a note to highlight the quick-start options available in the INSTALL.txt file.
Comment #246
maxstarkenburgWith Jeff Geerling's help (thanks!), I applied patch 2911319-2-245.patch on a Windows 7 Enterprise local install of Drupal 8.6.x (standard profile) using PowerShell and it opened in the browser and loaded fine. DrupalCon Nashville 2018. First issue, woo!
Comment #247
alexpottFixing the tests...
Comment #248
alexpott@geerlingguy do you have any idea how we could determine 192.168.88.88 or whatever it needs to be for DrupalVM automatically? Re #243
Comment #249
mlsamuelson CreditAttribution: mlsamuelson commentedI tested this on OS X with a local MAMP environment, PHP 7.1.8, and installed the demo_umami install profile successfully. Experience was smooth.
Comment #250
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commented@alexpott - Hmm, inside the VM itself, it would need to know what interface is being used and grab the IP from there... seems like it would be complicated to do automatically (and prone to breaking outside of a VM environment). I'd say documentation might be the best approach here.
Comment #251
David Radcliffe CreditAttribution: David Radcliffe commentedThis worked well for me on Mac OS. Here's my screencast. https://vimeo.com/264667336
Comment #252
pbirk CreditAttribution: pbirk commented@alexpott: I think determining the correct host to use should be the user's responsibility if 127.0.0.1 isn't going to work. I only ran into the issue because I was using DrupalVM when I choose to work on this issue at DrupalCon. A normal DrupalVM user gets a working environment after installing DrupalVM, so they're unlikely to attempt the quick-start command, anyways.
I think highlighting the available options is still a good idea, since we don't know what environment is in use. The first time I installed Drupal, it was directly on the same development server I hosted our custom PHP website. The same issue exists in that situation, but there's no automated way to determine the IP or port to use then, either.
Comment #253
maxstarkenburgAfter Ctrl-C'ing and bothering with some local git adding/committing stuff, I tried running
php core/scripts/drupal quick-start standard
again, but the admin password (which I wanted to reset) was too far up in the terminal to be accessible anymore. It was recommended I delete sites/default/settings.php, which I did and got the error message in the first screenshot. It was then suggested I delete sites/default/files/.sqlite, after which runningphp core/scripts/drupal quick-start standard
also produced different errors as seen in the second screenshot (that acomposer install
didn't fix). Windows 7 Enterprise.Comment #254
gerzenstl CreditAttribution: gerzenstl at 42mate commentedI tested the patch on a Vagrant machine. From the VM I needed to use a different domain on the "One time login url" link provided by the installer.
I think that a mention about --host parameter in the INSTALL.txt would be very helpful in these cases.
Other than that, the install experience was smooth.
Comment #255
gerzenstl CreditAttribution: gerzenstl at 42mate commentedComment #256
pbirk CreditAttribution: pbirk commented@maxstarkenburg and I are sitting together at DrupalCon now talking through the issue he points out in #253. We started from the beginning using his computer.
The crux of the issue is that it's very easy to miss or even lose the password and/or one-time login URL that appear in the quick-start commands output.
Here's what we experienced. This is after completely removing the Drupal directory and restarting with a fresh 8.6.x zip archive.
Now the following issues exist:
I think removing the request log output would help a lot. I'm also not sure why the first attempt to open the one-time access link redirected. That's not the behavior I saw on my system.
In addition to this description, Max is going to upload some screenshots.
Comment #257
maxstarkenburgHere are the screenshots as promised in #256. This seems like a pretty serious UX issue to me. I barely noticed the password output in PowerShell the first time and overlooked the messaging suggesting I change it in the browser.
Comment #258
dawehnerThank you for all the manual testing! So highly appreciate.
I'm curious whether adding a couple of new lines before and after would help?
Comment #259
dawehnerAdded the video to the issue summary
Comment #260
pbirk CreditAttribution: pbirk commented@dawehner: Do you mean whitespace above and below the password, etc... output to PowerShell? That might make it more noticeable, but wouldn't solve the potential problem of request log info pushing the info off the screen.
Comment #261
heddnIf we go the extra work of opening a browser, the attention now shifts to the browser. Few will ever look at the console again. I suggest that if we open the browser, we send folks to the user edit page where they can set the password. This is contrary to what was discussed in #228 and #146. We want folks to set the password. Otherwise they will forget to do that.
Most new users of Drupal I observe who use drush to generate a one-time long will almost always change the password on the user edit page. That is the desired outcome. Still print the password, yes. But also encourage the desired behaviour as well.
Comment #262
jonathanshawOne option would be to set username to "admin" and password to "password" and in addition to outputting that message in the console, also use drupal_set_message to tell people this in the browser too.
Another would be to put a one time login in drupal_set_message.
Comment #263
Mile23This setup is not so people can experience the thrill of changing their password. :-) It's so they can type a command and magically demo Drupal.
The initial password after installing is a random string, so it's unlikely to be easy to hack. We could make it a UUID or maybe longer than it is currently, if there's some concern. We shouldn't display the password in cleartext, and only give the one-time login URL.
Opening the browser should be the front page because that's what we're trying to show off. Ideally, we'd have a demo site they could explore that has some tour type stuff, but demo_umami is pretty good, too.
If you hit control-c and stop the server and then restart it, it should (and does) open the same site, and will give you a different one-time login link.
Let's add a message before the install process (so there's time to read it before it scrolls away) saying: "Don't do this on a production server."
Comment #264
Mile23Oops, accidentally changed IS.
Comment #265
alexpottBut this is supposed to be easy to use. This works for me on OSX. Can someone test on Windows. If you want the server request output just add -v to the command.
Note we had problems with Windows and Symfony's process component so I've done this without using this.
Comment #266
dawehnerThat is a good point!
Comment #267
ressa CreditAttribution: ressa at Ardea commentedI couldn't agree more.
Comment #268
ressa CreditAttribution: ressa at Ardea commentedDouble post.
Comment #269
dawehnerI updated the issue summary a bit.
Comment #270
dawehnerJust some tiny improvements.
One thing we could do in a follow up: We could look into the batch process of the actual installation process.
Comment #271
Anonymous (not verified) CreditAttribution: Anonymous commentedFantastic work!
I checked the #270 patch for Windows 10. Everything works fine: the site is successfully installed with different profiles (and languages) and automatically opens in the browser!
Only a couple of minor wishes:
First usage line bit confused:
quick-start [options] [--] [<install-profile>]
Why
[<install-profile>]
goes last, if in the examples below it goes first (I understand that there is no difference, but it's confusing).And what is
[--]
?Maybe better:
quick-start [<install-profile>] [--options]
Or even just delete this line?
Example usage, which would help me:
quick-start --host my-site.com --port 80
Because developers (I'm) can use specialized utilities to work with sites that allow access only by
folder-name
with default port. Not bylocalhost + special port
.First line contains placeholder %message%:
Announced 15 steps (if you choose a langcode). But
If the language is not selected, then 14/14 steps take place without problems.
Comment #272
alexpott@vaplas the help output is the default output from Symfony's console. If you think upstream improvements are in order then we should do them upstream.
The patch attached should fix the %message% and step counting for translations. Also wow importing translations is slow.
Comment #273
alexpottAdd usage suggested by @vaplas.
Comment #274
alexpottWhoops.
Comment #275
Anonymous (not verified) CreditAttribution: Anonymous commentedHah, I'm lol :)
@alexpott, many thanks for clarifying this point and the realization of everything else! #274 looks perfect! RTBC++
Comment #276
heddnWrt #263 (which I whole heartedly support), should we default to 'demo_umami'? Or standard? For someone who doesn't know anything about drupal, defaulting to which of the profiles should be selected could give the new user a helping hand. If they just select enter, then they would launch the demo?/standard?/
minimalprofile by default.If we go this route, I really like the suggestion in #263 to default to a demo install profile.
Comment #277
heddnThe following is what I currently get if I don't enter anything in response to the profile. While not bad, we could probably be a little more failsafe and check for an empty profile name.
Comment #278
mradcliffeThat's odd. What operating system and shell, @heddn?
I tried with windows 10 pro. and PowerShell with the patch in #274.
1. Downloaded PHP 7.1.16 binaries and extracted to C:\Program Files\PHP\php-7.1.16.
2. Installed Composer via Composer Setup.exe, and chose to use the PHP 7.1.16 php.exe.
3. Cloned drupal 8.6.x branch into c:\dev\drupal (using TortoiseGit).
4. Downloaded the ptach file in #274.
5. Opened PowerShell terminal (through VS Code).
6. Changed directory to C:\dev\drupal
7. Ran
git apply 2911319-2-274.patch
4. Ran
composer install
. Realized I needed to enable gd, curl and pdo_sqlite in C:\Program Files\PHP\php-7.1.16\php.ini.5. Ran
composer install
6. Ran
php core/scripts/drupal quickstart
7. Hit enter
8. Logged into an admin in my browser at http://127.0.0.1:8888/ and I got standard profile by default.
Edit: forgot that I also saw I needed to uncomment pdo_sqlite.
Comment #279
heddnStandard shell.
Comment #280
mradcliffeThanks, heddn.
I tried on my custom Slack box at home, but wasn't able to reproduce when hitting enter at the prompt. It successfully installed to the standard profile. I also tried putting a space, which had the same result (probably because spaces equate to false?).
I was only able to reproduce the issue when I starting over, I cleared out settings.php, but _not_ all the content of the files directory, which gave me that error because .sqlite file was still there.
Comment #281
heddnre #280: that's it, I forgot to clear out my files directory. I deleted settings.php. I didn't think about hunting for a sqlite file. I figured its name was semi-random at time of install so I wouldn't need to worry about it. Still NW or RTBC?
Comment #282
mradcliffeDoing another review I noticed INSTALL.txt:
Needs trailing colon?
"Installs Drupal and open it up". Huh? Do we mean "Now run the following command that installs Drupal"? Do we even need that? Maybe we should nuke that line?
I'm not sure if anyone's manually tested in PHP 5.5.9 although the test bot run should suffice. It's not added so I added a re-test of that.
Comment #283
mradcliffeHere's a patch to fix my nits and back to Needs review.
Comment #284
heddnThat last patch reminds me of a gripe I had when first writing the quickstart readme docs. It rather painful for first time users to know the latest stable version. Not to mention its hard to script in a predictable manner.
Could we have some niceness like github and others have? Where latest is an alias to the most recent stable release? That would clean-up this section of the docs a lot. And make it possible for a predictable and scriptable download of drupal.
https://ftp.drupal.org/files/projects/drupal-8-latest.zip
https://ftp.drupal.org/files/projects/drupal-7-latest.zip
Comment #285
phenaproxima+1000 for this idea, but it should not block committing this patch. Let's defer that to a follow-up issue.
Comment #286
heddnI've opened #2961550: Project download URL for latest stable release to address #284.
We're super close on this.
8.y.z is the more typical method to list minor and patch version number.
Lots of repetition of the word 'in'. Can we just say:
...will result in opening the new site in your web browser.
NOTE: should prefix this too. And consider moving it before the previous note.
Comment #287
heddnHmm, a little premature on RTBC. Let's see if we can fix these docs comments. And somehow figure out how to word that sqlite is a file and should be deleted in the install exception from #277
Comment #288
mradcliffeHow are these changes to INSTALL.txt?
1. I changed it to drupal-x.y.z for consistency as it is referenced already in the INSTALLATION section.
2. I moved the help section above the NOTE and reworded so that the command is on its own line with a bullet/hyphen indentation.
3. I referenced the REINSTALL section for how to start over.
I think the only major instruction is going to be to install PHP and to run
php core/scripts/drupal quick-start
because a user has to download Drupal and extract it to see core/INSTALL.txt (and that already has composer dependencies). I think those instructions are mainly for a Quick Start section on https://www.drupal.org/docs/8/install (or wherever else it is suitable in the work flow for evaluators).Comment #289
dawehnerIntroducing a new tag for making install.txt discoverable: #2961649: Add a /INSTALL.txt pointing to /core/INSTALL.txt
Comment #290
alexpottI've ummed and ahhed about adding something to the
Drupal is already installed.
message. I think it is important that this doesn't look like an error because you can use the quickstart command multiple times and it'll show you the message. Therefore I've wrapped theDrupal is already installed.
in info tags which makes it green. And add a message which saysIf you want to reinstall, remove sites/default/files and sites/default/settings.php.
to underline that this is choice.Comment #291
heddnSomething in the, "the site is already installed" logic isn't catching that the sqlite file still exists when the settings.php file is deleted. I still get the exception from install.core.inc, instead of the nice info error message in the latest interdiff. I'd paste the error, but it is the same as in #277. Nothing changed.
This refers to REINSTALL. But then REINSTALL refers users back to the non quick-start section.
We can fix that now or in a follow-up. Ideally we'd just tell folks to re-follow the install instructions without being specific about the step or type of install.
> 4. Follow the Installation Instructions above starting from Step 3 (Run the install script).
Comment #292
MixologicI fired this up last night to use it for some browser test troubleshooting, and had a couple trivial UX issues:
1.
Apparently there are *two* different sqlite php extensions, sqlite3, and pdo_sqlite -> maybe add PDO in that message somewhere to disambiguate?
2. If the assumption is that this is going to be targeted at somebody with no drupal knowledge, then I think that we should not ask the user to make any choices, and that the bare
php core/scripts/drupal quick-start
command should probably default to either standard or umami profile. (probably umami), with instructions/documentation on how to get a standard/minimal profile for more advanced users by passing the name in on the command line. At the same time, this kind of UX bikeshed can totally be ignored, or put into a followup.Comment #293
dawehnerI adapted the message and the link pointing to our own documentation.
I think it is quite valueable to show this power of Drupal quite early. I can totally see your argument, but yeah, I'm not sure.
Comment #294
dawehnerSorry, I forgot to change the pointer to your internal documentation
Comment #295
ressa CreditAttribution: ressa at Ardea commentedAfter applying the patch (which seems to work fine) I get this warning:
Comment #296
alexpottFixing whitespace in patch.
Comment #297
ressa CreditAttribution: ressa at Ardea commentedThanks @alexpott, the warning is now gone.
Comment #298
Anonymous (not verified) CreditAttribution: Anonymous commentedIt seems all the feedbacks were addressed, back to RTBC!
Perhaps some suggestions about the default settings, output info and documentation can be discussed in a follow-up issue, if necessary. In order not to combine the "provide command to install" and "prediction of the future" in one issue.
Comment #299
mradcliffe@heddn's comment in #291 wasn't addressed about the error message not firing (correctly?).
I'm not sure if that blocks this issue or not.
Comment #300
larowlanOnly nits, none should block commit.
Couple of follow-ups worth exploring.
Inside this callable, we do have access to $this.
Do you think we should set a class property instead of using a static?
this feels like a utility that would have merit elsewhere - do you think it warrant a follow up to create a standalone class?
Worth a follow-up to try and undo this in CommentManager?
Worth a follow up to explore making these standalone utilities?
Comment #301
larowlanUpdating review credits for those who
- provided reviews that changed the shape of the patch
- provided significant issue summary updates
- provided testing reports that shaped the patch
- provided documentation of the process on their machine
There are a lot of comments, if you think I've missed anyone, let me know.
Comment #302
Mile23run-tests.sh also does an open-browser type thing: https://cgit.drupalcode.org/drupal/tree/core/scripts/run-tests.sh#n1526
Comment #303
dawehnerHere are a couple of follow ups:
Given this is adding via
url_generator
I'm not sure how likely it is to achieve thisComment #304
larowlanWe need a change notice here.
I discussed with @kim.pepper who is willing to write one today.
Comment #305
kim.pepperAdded a draft change notice. https://www.drupal.org/node/2969396
Comment #307
larowlanCommitted 573702f and pushed to 8.6.x.
Published the change record.
To everyone who was involved here, thank you so much, this is a significant outcome for Drupal
Comment #308
Mile23User guide issue: #2969725: Add documentation about command-line quick start tool (8.6)
Comment #309
dawehnerI'm wondering whether this new feature / task could be something which gets added to 8.5? The documentation on drupal.org could profit from that for example.
Comment #310
cilefen CreditAttribution: cilefen at Institute for Advanced Study commented#2969715: Drush site-install command doesn't work when settings.php is present
Comment #311
kay_v CreditAttribution: kay_v as a volunteer commentedNice writeup in the change record, @kim.pepper ([#2969396]). FYI, I've taken it pretty much as is and created a proposed user guide page. Comments/improvements of course welcomed!
Comment #313
Anonymous (not verified) CreditAttribution: Anonymous commented#2966607: Invalidating 'node_list' and other broad cache tags early in a transaction severely increases lock wait time and probability of deadlock - stable fail with QuickStartTest.
#2975644: Random Failure in Drupal\Tests\Core\Command\QuickStartTest - random fails.