Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting Drush Commands in DrupalConsole #1522

Open
itsdarrylnorris opened this issue Dec 18, 2015 · 9 comments
Open

Supporting Drush Commands in DrupalConsole #1522

itsdarrylnorris opened this issue Dec 18, 2015 · 9 comments

Comments

@itsdarrylnorris
Copy link
Contributor

itsdarrylnorris commented Dec 18, 2015

Problem / Motivation

There is it seem to be some incompatibility of command drush and DrupalConsole. For this reason, we are going to remove drush command from Drupal Console see more at #1520.

However, Drush still an amazing command tool that we should take advantage in of some their functionality with in side of Drupal Console but without a bridge. Instead we should build the functionality from scratch so we do not need to support bridges problems.

Solution

Lets take care of the Drush functionality inside of Drupal Console one by one. This issue is mainly to keep track of what is going with the functionality from Drush. There is going to be a list drush of command below in this issue and some instructions on how we are going to keep track of this issues.

If this functionality is already in Drupal Console lets added lets check the checkbox and add the link of the command that replace it in Drupal Console.

  • variable-set (vset) Set a variable.
    • config:override - The config:override command Override config value in active configuration.

If the functionality is not in Drupal Console lets open an issue added the link of that issue like this.

Here is a list of all drush commands:

  • archive-dump (ard, Backup your code, files, and database into a single file.
  • archive-restore Expand a site archive into a Drupal web site.
  • browse Display a link to a given path or open link in a browser.
  • core-cli (php) Open an interactive shell on a Drupal site.
  • core-config (conf, Edit drushrc, site alias, and Drupal settings.php files.
  • core-cron (cron) Run all cron hooks in all active modules for specified site.
    • cron:execute - The cron:execute command Execute cron implementations by module or execute all crons
  • core-execute (exec, Execute a shell command. Usually used with a site alias.
  • core-quick-drupal Download, install, serve and login to Drupal with minimal configuration and dependencies.
  • core-requirements Provides information about things that may be wrong in your Drupal installation, if any.
    • site:status - The site:status command View current Drupal Installation status
  • core-rsync (rsync) Rsync the Drupal tree to/from another server using ssh.
  • core-status (status, Provides a birds-eye view of the current Drupal installation, if any.
    • site:status - The site:status command View current Drupal Installation status
  • core-topic (topic) Read detailed documentation on a given topic.
  • drupal-directory Return the filesystem path for modules/themes and other key folders.
  • entity-updates Apply pending entity schema updates.
  • help Print this help message. See drush help help for more options.
    • --help Display this help message
  • image-derive (id) Create an image derivative.
  • image-flush (if) Flush all derived images for a given style.
  • php-eval (eval, ev) Evaluate arbitrary php code after bootstrapping Drupal (if available).
  • php-script (scr) Run php script(s).
  • queue-list Returns a list of all defined queues
  • queue-run Run a specific queue by name
  • shell-alias (sha) Print all known shell alias records.
  • site-alias (sa) Print site alias records for all known site aliases and local sites.
  • site-install (si) Install Drupal along with modules/themes/configuration using the specified install profile.
  • site-set (use) Set a site alias to work on that will persist for the current session.
  • site-ssh (ssh) Connect to a Drupal site's server via SSH for an interactive session or to run a shell command
  • twig-compile (twigc) Compile all Twig template(s).
  • updatedb (updb) Apply any database updates required (as with running update.php).
  • updatedb-status List any pending database updates.
  • usage-send (usend) Send anonymous Drush usage information to statistics logging site. Usage statistics contain the Drush command name and the Drush option names, but no arguments or option values.
  • usage-show (ushow) Show Drush usage information that has been logged but not sent. Usage statistics contain the Drush command name and the Drush option names, but no arguments or option values.
  • variable-delete Delete a variable.
    • Command variable-get requires Drupal core version 6 or 7 to run. For this reason, this command does not apply for DrupalConsole.
  • variable-get (vget) Get a list of some or all site variables and values.
    • Command variable-get requires Drupal core version 6 or 7 to run. For this reason, this command does not apply for DrupalConsole.
  • variable-set (vset) Set a variable.
    • config:override - The config:override command Override config value in active configuration.
  • version Show drush version.
    • --version - Display this application version
  • cache-clear (cc) Clear a specific cache, or all drupal caches.
    • cache:rebuild (cr) - The cache:rebuild command Rebuild and clear all site caches.
  • cache-get (cg) Fetch a cached object and display it.
  • cache-rebuild (cr, Rebuild a Drupal 8 site and clear all its caches.
    • cache:rebuild (cr) - The cache:rebuild command Rebuild and clear all site caches.
  • cache-set (cs) Cache an object expressed in JSON or var_export() format.
  • config-edit (cedit) Open a config file in a text editor. Edits are imported into active configration after closing editor.
  • config-export (cex) Export configuration to a directory.
    • config:export - The config:export command Export current application configuration.
    • config:export:content:type - The config:export:content:type command Export a specific content type and their fields.
    • config:export:single - The config:export:single command Export single configuration as yml file.
    • config:export:view - The config:export:view command Export a view in YAML format inside a provided module to reuse in other website.
  • config-get (cget) Display a config value, or a whole configuration object.
  • config-import (cim) Import config from a config directory.
    • config:import - The config:import command Import configuration to current application.
    • config:import:single - The config:import:single command Import the selected configuration.+
  • config-list (cli) List config names by prefix.
  • config-set (cset) Set config value directly.
  • field-clone Clone a field and all its instances.
  • field-create Create fields and instances. Returns urls for field editing.
  • field-delete Delete a field and its instances.
  • field-info View information about fields, field_types, and widgets.
  • field-update Return URL for field editing web page.
  • pm-disable (dis) Disable one or more extensions (modules or themes).
  • pm-download (dl) Download projects from drupal.org or other sources.
  • pm-enable (en) Enable one or more extensions (modules or themes).
  • pm-info (pmi) Show detailed info for one or more extensions (modules or themes).
  • pm-list (pml) Show a list of available extensions (modules and themes).
  • pm-refresh (rf) Refresh update status information.
  • pm-releasenotes Print release notes for given projects.
  • pm-releases (rl) Print release information for given projects.
  • pm-uninstall (pmu) Uninstall one or more modules.
  • pm-update (up) Update Drupal core and contrib projects and apply any pending database updates (Same as pm-updatecode + updatedb).
  • pm-updatecode (upc) Update Drupal core and contrib projects to latest recommended releases.
  • pm-updatestatus Show a report of available minor updates to Drupal core and contrib projects.
  • role-add-perm (rap) Grant specified permission(s) to a role.
  • role-create (rcrt) Create a new role.
  • role-delete (rdel) Delete a role.
  • role-list (rls) Display a list of all roles defined on the system. If a role name is provided as an argument, then all of the permissions of that role will be listed. If a permission name is provided as an option, then all of the roles that have been granted that permission will be listed.
  • role-remove-perm Remove specified permission(s) from a role.
  • runserver (rs) Runs PHP's built-in http server for development.
  • sql-cli (sqlc) Open a SQL command-line interface using Drupal's credentials.
  • sql-connect A string for connecting to the DB.
  • sql-create Create a database.
  • sql-drop Drop all tables in a given database.
  • sql-dump Exports the Drupal DB as SQL using mysqldump or equivalent.
  • sql-query (sqlq) Execute a query against a database.
  • sql-sanitize Run sanitization operations on the current database.
  • sql-sync Copies the database contents from a source site to a target site. Transfers the database dump via rsync.
  • search-index Index the remaining search items without wiping the index.
  • search-reindex Force the search index to be rebuilt.
  • search-status Show how many items remain to be indexed out of the total.
  • state-delete (sdel) Delete a state value.
  • state-get (sget) Display a state value.
  • state-set (sset) Set a state value.
  • user-add-role (urol) Add a role to the specified user accounts.
  • user-block (ublk) Block the specified user(s).
  • user-cancel (ucan) Cancel a user account with the specified name.
  • user-create (ucrt) Create a user account with the specified name.
  • user-information Print information about the specified user(s).
  • user-login (uli) Display a one time login link for the given user account (defaults to uid 1).
  • user-password (upwd) (Re)Set the password for the user account with the specified name.
  • user-remove-role Remove a role from the specified user accounts.
  • user-unblock (uublk) Unblock the specified user(s).
  • watchdog-delete Delete watchdog messages.
  • watchdog-list Show available message types and severity levels. A prompt will ask for a choice to show watchdog messages.
  • watchdog-show Show watchdog messages.
  • make Turns a makefile into a working Drupal codebase.
  • make-convert Convert a legacy makefile into YAML format.
  • make-generate Generate a makefile from the current Drupal site.
  • (generate-makefile)
  • make-update Process a makefile and outputs an equivalent makefile with projects version resolved to latest available.
@itsdarrylnorris itsdarrylnorris changed the title Supporting Drush Command in DrupalConsole Supporting Drush Commands in DrupalConsole Dec 18, 2015
@jmolivas
Copy link
Member

jmolivas commented Sep 5, 2016

Copy/paste format suggestion

Proposed format:

Drush Command Description Equivalent Will not Implement Notes
config-get Display a config value, or a whole configuration object. config:debug

@novia713
Copy link
Contributor

novia713 commented Sep 6, 2016

i would like to add some existing commands (not all)
(perhaps a shared gist it's a better place to do this)

Drush Command Description Equivalent Will not Implement Notes
core-execute Execute a shell command exec "ls -la"
help Print help message help or help site:install
image-flush Flush all derived images for a given style image:styles:flush
site-alias Print site alias records for all known site aliases and local sites site:debug
site-install Print site alias records for all known site aliases and local sites site:install
updatedb Apply any database updates required update:execute
updatedb-status List any pending database updates update:debug
entity-updates Apply pending entity schema updates update:entities

.

@novia713
Copy link
Contributor

novia713 commented Sep 6, 2016

@darol100 i made my own list at https://gist.github.com/novia713/1097c221fb409bb43712667650f2cc42
feel free to use it in the most convenient way for you
@jmolivas i think having a list like https://gist.github.com/novia713/1097c221fb409bb43712667650f2cc42
actualized would be very useful. perhaps would be a good a idea to put it in some repository where some people could maintain the listing

@Saphyel
Copy link
Contributor

Saphyel commented Sep 7, 2016

I use D8 at work everyday and well for me, the most important commands (because our workflow) are mainly this list (so they are my priority):

  • drush make
  • drush si
  • drush core-cron
  • drush uli
  • drush ucrt
  • drush urol
  • drush cex
  • drush config-devel-export
  • drush config-devel-import
  • drush dcem
  • drush dcer
  • drush updb -y
  • drush cr
  • drush sql-drop -y
  • drush sql-cli
  • drush sql-dump
  • drush cset
  • drush cim

(I think I miss a few but I'm sure that they are not at the moment in drupalconsole yet)

And as I said to @novia713 yesterday I think is better a repository like this one: https://github.com/mpalourdio/xps13 so we can do pull request and etc for change/update the documentation.

@jmolivas
Copy link
Member

jmolivas commented Sep 7, 2016

@novia713 @Saphyel @darol100

We just need to maintain a YML file with this structure on a repo (still deciding if this one or drupal-console-core instead):

commands:
  core:
    archive-dump: ~
    config-debug: config:debug
    config-export: config:export
    config-import: config:import
    archive-dump: ~
    archive-restore: ~
    browse: ~
    core-cli: ~
    core-config: ~
    core-cron: ~
    core-execute: ~
    core-init: init
    core-quick-drupal: ~
    core-requirements: site:status
    core-rsync: ~
    core-status: site:status
    core-topic: ~
    drupal-directory: ~
    entity-updates: update:entities
    help: help
    site-install: site:install
  make:
    make: ~
    make-convert: ~

A new command will be released with RC-1

This could be executed without arguments and will show the full list of equivalents:

drupal-drush-equivalent-1

If a drush command is passed and DC provides an equivalent, it will show which command maps on DC and will execute a help command to see information of the command in DC.

drupal-drush-equivalent-2

@nvaken
Copy link
Contributor

nvaken commented Feb 21, 2017

Just to add, I'd love to see a port of sql-sanitize, not really sure how this port should be approached though. The command makes use of special Drush module hooks (hook_drush_sql_sync_sanitize()). The naming convention of this hook suggest we should not use this for console. Though, I'm wondering if this hook should be generalised, allowing both drush, drupal and others to implement this hook. Something like: hook_sql_sync_sanitize()? But, this might be out of scope for this overview issue. Should I create a new issue for this matter?

@jmolivas
Copy link
Member

@nvaken create a new issue will be great to address this as new feature.

@nvaken
Copy link
Contributor

nvaken commented Feb 21, 2017

@jmolivas Done! See #3192

@iBobik
Copy link

iBobik commented Jan 3, 2020

Missing l10n commands for updating translations - #3920

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants