previousnext/drush_cmi_tools

drush 9 version not working

Closed this issue · 8 comments

Hi,

I had followed the instructions to install these commands using composer and using wget. Either fails as the commands are not recognised.

Later, I had follow this instructions without success. I had chat with Moshe Weiztman, and he point me to correct information on namespace and directory location. I had corrected the namespace and location and after executing drush cr I receive an error.

The problem arises when porting your line code
if (drush_get_option('preview', 'list') == 'list') {
to
if ($option['preview', 'list'] == 'list') {

I'm not a developer and I had no experience on PHP. Could you give some advice?

thanks,

Mario

@jibran are you using the drush 9 version?

Yes, I'm. Just install the 8.x-2.x branch as any module by using composer require "drupal/drush-cmi-tools": "dev-8.x-2.x" or dropping it in module directory. After enabling the module you can use it without any issue with drush 9.

@jibran I had reinstall cmi-tools-plus following your instrutions. No success. Here's the output

[drupadmin@lvwdrup8devapp drup8dev]$ composer require "drupal/drush-cmi-tools:dev-8.x-2.x"
./composer.json has been updated
Loading composer repositories with package information                                                          Updating dependencies (including require-dev)         Package operations: 25 installs, 0 updates, 0 removals
  - Installing symfony/var-dumper (v3.4.13): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/polyfill-ctype (v1.8.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/filesystem (v3.4.13): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing chi-teck/drupal-code-generator (1.25.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing dflydev/dot-access-data (v1.1.0): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing grasmash/expander (1.0.0): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing consolidation/config (1.0.11): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing webflo/drupal-finder (1.1.0): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/finder (v3.4.13): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing container-interop/container-interop (1.2.0): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing league/container (2.4.1): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing grasmash/yaml-expander (1.4.0): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing consolidation/output-formatters (3.2.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing consolidation/log (1.0.6): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/config (v3.4.13): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing consolidation/annotated-command (2.8.4): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing consolidation/robo (1.3.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing webmozart/path-util (2.3.0): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing nikic/php-parser (v4.0.3): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing jakub-onderka/php-console-color (0.1): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing jakub-onderka/php-console-highlighter (v0.3.2): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing dnoegel/php-xdg-base-dir (0.1): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing psy/psysh (v0.9.6): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drush/drush (9.3.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/drush-cmi-tools (dev-8.x-2.x 0e55ad2): Cloning 0e55ad2851
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
symfony/var-dumper suggests installing ext-symfony_debug ()
consolidation/robo suggests installing henrikbjorn/lurker (For monitoring filesystem changes in taskWatch)
consolidation/robo suggests installing natxet/CssMin (For minifying CSS files in taskMinify)
consolidation/robo suggests installing patchwork/jsqueeze (For minifying JS files in taskMinify)
consolidation/robo suggests installing pear/archive_tar (Allows tar archives to be created and extracted in taskPack and taskExtract, respectively.)
psy/psysh suggests installing ext-posix (If you have PCNTL, you'll want the POSIX extension as well.)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
[drupadmin@lvwdrup8devapp drup8dev]$ drush cr
 [success] Cache rebuild complete.
[drupadmin@lvwdrup8devapp drup8dev]$ drush | grep cexy
[drupadmin@lvwdrup8devapp drup8dev]$ drush
Drush Commandline Tool 9.3.0

Run `drush help [command]` to view command-specific help.  Run `drush topic` to read even more documentation.

 Available commands:
 _global:
   help                                                                       Display usage details for a command.
   list                                                                       List available commands.
   generate (gen)                                                             Generate boilerplate code for modules/plugins/services etc.
   updatedb (updb)                                                            Apply any database updates required (as with running update.php).
   version                                                                    Show Drush version.
   browse                                                                     Display a link to a given path or open link in a browser.
   runserver (rs, serve)                                                      Runs PHP's built-in http server for development.
   updatedb:status (updbst)                                                   List any pending database updates.
   drupal:directory (dd)                                                      Return the filesystem path for modules/themes and other key folders.
 cache:
   cache:get (cg)                                                             Fetch a cached object and display it.
   cache:clear (cc)                                                           Clear a specific cache, or all Drupal caches.
   cache:set (cs)                                                             Cache an object expressed in JSON or var_export() format.
   cache:rebuild (cr, rebuild)                                                Rebuild a Drupal 8 site.
 config:
   config:pull (cpull)                                                        Export and transfer config from one environment to another.
   config:get (cget)                                                          Display a config value, or a whole configuration object.
   config:set (cset)                                                          Set config value directly. Does not perform a config import.
   config:edit (cedit)                                                        Open a config file in a text editor. Edits are imported after closing editor.
   config:delete (cdel)                                                       Delete a configuration key, or a whole object.
   config:status (cst)                                                        Display status of configuration (differences between the filesystem configuration
                                                                              and database configuration).
   config:export (cex)                                                        Export Drupal configuration to a directory.
   config:import (cim)                                                        Import config from a config directory.
 core:
   core:status (status, st)                                                   An overview of the environment - Drush and Drupal.
   core:execute (exec, execute)                                               Execute a shell command. Usually used with a site alias.
   core:topic (topic)                                                         Read detailed documentation on a given topic.
   core:edit (conf, config)                                                   Edit drushrc, site alias, and Drupal settings.php files.
   core:init (init)                                                           Enrich the bash startup file with bash aliases and a smart command prompt.
   core:rsync (rsync)                                                         Rsync Drupal code or files to/from another server using ssh.
   core:cron (cron)                                                           Run all cron hooks in all active modules for specified site.
   core:requirements (status-report, rq)                                      Information about things that may be wrong in your Drupal installation.
 devel:
   devel:reinstall (dre)                                                      Uninstall, and Install modules.
   devel:hook (fnh, fn-hook, hook)                                            List implementations of a given hook and optionally edit one.
   devel:event (fne, fn-event, event)                                         List implementations of a given event and optionally edit one.
   devel:token (token)                                                        List available tokens.
   devel:uuid (uuid)                                                          Generate a UUID.
   devel:services (devel-container-services, dcs)                             Get a list of available container services.
 entity:
   entity:updates (entup)                                                     Apply pending entity schema updates.
   entity:delete (edel)                                                       Delete content entities.
 image:
   image:flush (if)                                                           Flush all derived images for a given style.
   image:derive (id)                                                          Create an image derivative.
 locale:
   locale:check                                                               Checks for available translation updates.
   locale:update                                                              Imports the available translation updates.
 php:
   php:eval (eval, ev)                                                        Evaluate arbitrary php code after bootstrapping Drupal (if available).
   php:script (scr)                                                           Run php a script after a full Drupal bootstrap.
   php:cli (php, core:cli, core-cli)                                          Open an interactive shell on a Drupal site.
 pm:
   pm:security (sec)                                                          Check Drupal Composer packages for pending security updates.
   pm:enable (en)                                                             Enable one or more modules.
   pm:uninstall (pmu)                                                         Uninstall one or more modules and their dependent modules.
   pm:list (pml)                                                              Show a list of available extensions (modules and themes).
 queue:
   queue:run                                                                  Run a specific queue by name.
   queue:list                                                                 Returns a list of all defined queues.
   queue:delete                                                               Delete all items in a specific queue.
 role:
   role:create (rcrt)                                                         Create a new role.
   role:delete (rdel)                                                         Delete a new role.
   role:perm:add (rap, role-add-perm)                                         Grant specified permission(s) to a role.
   role:perm:remove (rmp, role-remove-perm)                                   Remove specified permission(s) from a role.
   role:list (rls)                                                            Display a list of all roles defined on the system.
 search-api:
   search-api:list (sapi-l)                                                   Lists all search indexes.
   search-api:enable (sapi-en)                                                Enables one disabled search index.
   search-api:enable-all (sapi-ena)                                           Enables all disabled search indexes.
   search-api:disable (sapi-dis)                                              Disables one or more enabled search indexes.
   search-api:disable-all (sapi-disa)                                         Disables all enabled search indexes.
   search-api:status (sapi-s)                                                 Shows the status of one or all search indexes.
   search-api:index (sapi-i)                                                  Indexes items for one or all enabled search indexes.
   search-api:reset-tracker (search-api-mark-all, search-api-reindex, sapi-r) Marks one or all indexes for reindexing without deleting existing data.
   search-api:clear (sapi-c)                                                  Clears one or all search indexes and marks them for reindexing.
   search-api:search (sapi-search)                                            Searches for a keyword or phrase in a given index.
   search-api:server-list (sapi-sl)                                           Lists all search servers.
   search-api:server-enable (sapi-se)                                         Enables a search server.
   search-api:server-disable (sapi-sd)                                        Disables a search server.
   search-api:server-clear (sapi-sc)                                          Clears all search indexes on the given search server.
   search-api:set-index-server (sapi-sis)                                     Sets the search server used by a given index.
 site:
   site:install (si, sin)                                                     Install Drupal along with modules/themes/configuration/profile.
   site:set (use)                                                             Set a site alias that will persist for the current session.
   site:alias (sa)                                                            Show site alias details, or a list of available site aliases.
   site:alias-convert (sa-convert, sac)                                       Convert legacy site alias files to the new yml format.
   site:ssh (ssh)                                                             Connect to a Drupal site's server via SSH.
 sql:
   sql:connect                                                                A string for connecting to the DB.
   sql:create                                                                 Create a database.
   sql:drop                                                                   Drop all tables in a given database.
   sql:cli (sqlc)                                                             Open a SQL command-line interface using Drupal's credentials.
   sql:query (sqlq)                                                           Execute a query against a database.
   sql:dump                                                                   Exports the Drupal DB as SQL using mysqldump or equivalent.
   sql:sync                                                                   Copy DB data from a source site to a target site. Transfers data via rsync.
   sql:sanitize (sqlsan)                                                      Sanitize the database by removing or obfuscating user data.
 state:
   state:get (sget)                                                           Display a state value.
   state:set (sset)                                                           Set a state value.
   state:delete (sdel)                                                        Delete a state entry.
 theme:
   theme:enable (then)                                                        Enable one or more themes.
   theme:uninstall (thun)                                                     Uninstall theme.
 twig:
   twig:unused                                                                Find potentially unused Twig templates.
   twig:compile (twigc)                                                       Compile all Twig template(s).
 user:
   user:login (uli)                                                           Display a one time login link for user ID 1, or another user.
   user:information (uinf)                                                    Print information about the specified user(s).
   user:block (ublk)                                                          Block the specified user(s).
   user:unblock (uublk)                                                       UnBlock the specified user(s).
   user:role:add (urol, user-add-role)                                        Add a role to the specified user accounts.
   user:role:remove (urrol, user-remove-role)                                 Remove a role from the specified user accounts.
   user:create (ucrt)                                                         Create a user account.
   user:cancel (ucan)                                                         Cancel user account(s) with the specified name(s).
   user:password (upwd)                                                       Set the password for the user account with the specified name.
 views:
   views:dev (vd)                                                             Set several Views settings to more developer-oriented values.
   views:list (vl)                                                            Get a list of all views in the system.
   views:execute (vex)                                                        Execute a view and show a count of the results, or the rendered HTML.
   views:analyze (va)                                                         Get a list of all Views and analyze warnings.
   views:enable (ven)                                                         Enable the specified views.
   views:disable (vdis)                                                       Disable the specified views.
 watchdog:
   watchdog:show (wd-show, ws)                                                Show watchdog messages.
   watchdog:list (wd-list)                                                    Interactively filter the watchdog message listing.
   watchdog:delete (wd-del, wd-delete, wd)                                    Delete watchdog log records.
   watchdog:show-one (wd-one)                                                 Show one log record by ID.
 webform:
   webform:export (wfx)                                                       Exports webform submissions to a file.
   webform:purge (wfp)                                                        Purge webform submissions from the databases
   webform:tidy (wft)                                                         Tidy export webform configuration files
   webform:libraries:status (wfls)                                            Displays the status of third party libraries required by the Webform module.
   webform:libraries:make (wflm)                                              Generates libraries YAML to be included in a drush.make.yml files.
   webform:libraries:composer (wflc)                                          Generates the Webform module's composer.json with libraries as repositories.
   webform:libraries:download (wfld)                                          Download third party libraries required by the Webform module.
   webform:libraries:remove (wflr)                                            Removes all downloaded third party libraries required by the Webform module.
   webform:generate (wfg)                                                     Create submissions in specified webform.
   webform:repair (wfr)                                                       Makes sure all Webform admin settings and webforms are up-to-date.
   webform:docs (wfd)                                                         Generates HTML documentation.
   webform:composer:update (wfcu)                                             Updates the Drupal installation's composer.json to include the Webform module's
                                                                              selected libraries as repositories.
   webform:generate:commands (wfgc)                                           Generate Drush commands from webform.drush.inc for Drush 8.x to WebformCommands for
                                                                              Drush 9.x.
   webform:scheduled-email:cron (wfsec)                                       Executes cron task for webform scheduled emails.

Composer version 1.6.5 2018-05-04 11:44:59
 Drush version : 9.3.0

You have to enable the module using drush en drush_cmi_tools -y before using drush cexy

jibran, thanks a lot. That was the missing detail.