When installing Console, core composer.json is modified and components are put into core/vendor. Is there a way to avoid this? Tried using Composer Manager module but couldn't solve the issue yet.

CommentFileSizeAuthor
#10 console-global.gif382.18 KBjmolivas
#9 drupal-console-phar.gif393.5 KBjmolivas
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jmolivas’s picture

Modifying the composer.json file is a common behavior in Symfony applications, but not drupal. We are just adding a fee new vendor libraries, the issue is related to vendor directory is inside core directory.

I haven't try Composer Manager yet, would you mind to share what you did and what was the reason didn't work @kpv ?

We are aware of this and still trying to figure out if there is something we can do, I recall at earlier versions we provided a console.phar file this was a stand alone console distribution that could be a solution.

jmolivas’s picture

Component: Documentation » Miscellaneous
Fabianx’s picture

Title: Can Console be installed without changing core files? » Integrate console with drush, system wide installation - without changing core drupal
Category: Support request » Task
Priority: Normal » Major

Talked with @jmolivas about this at DrupalCon:

The idea to fix this is to allow the following workflow:

$ drush -y dl console 
Console was downloaded to ~/.drush/console/
$ drush console router:debug
Downloading console component... 
Downloading composer ...
Running composer ...
...
Resolving dependencies ...

All okay.

// Output of router debug.

For any further command:

$ drush console router:debug
// Output of router debug.

So to expose the debug console to drush.

That is as simple as providing a drush command like - registry_rebuiild module.

And having no .module file.

Its also installed system wide for all drupal sites, which is a big plus!

In a more advanced version all commands of the debug console could be exposed via hook_drush_command directly, which combines both worlds nicely.

kpv’s picture

It looks logical to use console as drush extension rather than a module (if you mean that). But I'll just point out the case when some other module would like to use console functionality (such as Entity Construction Kit) - wouldn't it be too complex for an average user to make it work?

slashrsm’s picture

I tried to use composer_manager to a project we're working on. It looks that the main problem was in bin directory. Console assumes it will be in root folder but I wasn't able to convince composer_manager to install it there. Would it be possible to make installation dir configurable? Maybe by using an env variable?

Fabianx’s picture

Well, the Entity Construction Kit would just register the services or not? - which should work even with it being globally installed.

kpv’s picture

Then user should be able to work with command prompt and install drush. It's not always the case.
Also not sure if we should concern too much about this.

jmolivas’s picture

FileSize
393.5 KB

we just release an installer & executable phar file for the project

//Change to Drupal 8 installation root directory
$ cd path/to/drupal8.dev
          
// Run curl in your terminal:
$ curl -LSs http://drupalconsole.com/installer | php
          
// Or if you don't have curl:
$ php -r "readfile('http://drupalconsole.com/installer');" | php

//Use the console.phar 
$ php console.phar

When using the new installer method, we are no longer modifying the composer.json & composer.lock files or adding extra libraries to "core/vendor" directory.

Next step is make as global installation once that is done we can try to work on the drush integration

jmolivas’s picture

FileSize
382.18 KB

We just did a new release and this is how the system wide installation looks like

// Run this in your terminal to get the latest Console version:
$ curl -LSs http://drupalconsole.com/installer | php
  
// Or if you don't have curl:
$ php -r "readfile('http://drupalconsole.com/installer');" | php
  
// Accessing console from anywhere on your system:
$ mv console.phar /usr/local/bin/drupal
  
// Use the project
$ drupal generate:module

More information: http://jmolivas.com/install-drupal-console-globally

dmouse’s picture

Status: Active » Closed (fixed)

With the phar file You not change the Drupal Core

kpv’s picture

Status: Closed (fixed) » Active

Propose to keep this issue open until we get a generic solution.

jmolivas’s picture

I spent two days working with Greg Anderson on a console/drush integration the result was several updates to Console plus this PR to drush:

https://github.com/drush-ops/drush/pull/1337

kpv’s picture

darol100’s picture

Status: Active » Closed (won't fix)

Closing this issue since DrupalConsole does not support Drush anymore. Lets kill the bridge between Drupal Console and Drush #1520