Steps to make a non-Composer D7 project work with Drush Launcher #33
Comments
Do I need to start over and restructure all old D7 projects along https://github.com/drupal-composer/drupal-project/tree/7.x? |
Thats my recommendation, yes. The code which finds your site is at
https://github.com/webflo/drupal-finder/. You might be able to gean some
insight there.
|
I see, I see. I guess the only other option then would be to skip D7 Composer and make a |
As pointed out by @DuaelFr and @webflo in webflo/drupal-finder#35 providing a composer.json skeleton with only {
"require": {
"drush/drush": "8.*"
},
"extra": {
"installer-paths": {
"docroot": ["type:drupal-core"]
}
}
} Edit: You have to |
My drupal root is "drupal" and composer.json is
But when I am executing drush cc all it says |
@dbjpanda - |
@dbjpanda ... and |
The installation with this composer.json file works fine. Everything is ending up in a vendor directory and looks correct. Drush appears to be functional. But: I've tried it on two D7 installation, and I get the "No Drupal site found" Error. Somehow Drush has a problem of recognizing the drupal installation it finds itself in. This is using DrupalVM, which has Drush launcher installed which works for D8 sites. |
So, as I understand this ticket #36 this does not work. I went with installing a global drush like described here To permanently export The fallback option probably should also work with a drush installed locally in your site like described above. But having to do this for every Drupal installation appears more work than to install a global fallback option. |
Honestly I don't fully understand what your problem is. But I can absolutely confirm that Drush Launcher works in D7 perfectly fine as long as you have a correctly configured composer.json, see #33 (comment). The following example lives in the D7 root.
|
I can image this might even work in D6 as well. |
O.K. I see. As recommended by Moshe one has to use the drupal-composer layout for the drupal project. I did not use that but only the composer.json from #33 (comment). |
You cannot use this strategy to update Drupal core. There is some weird quirk with copying the files that will break everything if you try. |
Indeed. Setting the docroot to
|
I guess this only affects updating core. |
I'll reiterate for clarity
This is not supported. If you have a non Composer project, your best bets are to convert to Composer, or use Drush 8 directly, instead of drush-launcher. |
My drupal core is inside var/www/html/drupal So I had set 'drupal'. But unfortunately It didn't work for me.
But when I set 'core' instead of 'drupal' It works :)
Incase any one wants to set up a D7 with all the tools available in one click he/she may have looked at this https://github.com/dbjpanda/digitalocean-drupal/tree/7.x |
@dbjpanda When you start a new D7 project you'd better start it with https://github.com/drupal-composer/drupal-project/tree/7.x instead of just the Composer skeleton from this thread.
|
I successfully installed Drupal Launcher and can confirm it works for all my D8 projects built with https://github.com/drupal-composer/drupal-project. Some with Drush 8, some with Drush 9, Drush Launcher always takes the right Drush from /vendor.
Now I do have some old Drupal 7 projects (all of them managed the old way, without Composer) here and would like to restructure them in a way to be able to use the Drush Launcher with them as well.
mkdir /User/norman/Sites/my-project
cd /User/norman/Sites/my-project
composer require drush/drush
mv /User/norman/Sites/old-d7-singlesite /User/norman/Sites/my-project/web
cd web
drush cc all
Tried all of the suggestions, none of them worked, they all produce the same error message.
What else do I need to do to refurbish an old D7 project and make use of Drupal Launcher there?
The text was updated successfully, but these errors were encountered: