Then, you'll be presented with multiple methods to enable and multiple formats to choose from, as well (e.g. vendor/bin/drupal rest:enable entity:node Then, you can analyze all your plugins individually.Īlso, you have another command at your disposal for quickly enabling specific endpoints. Just enter this command to get all your currently available RESTful endpoints listed: $. Here's another area where Drupal Console turns out to be a powerful competitor for Drush: it enables you to manage your RESTful endpoint plugin configurations right from your CLI. Yet, this set of commands' debugging functionality covers a lot more aspects of your Drupal website: … that you get to trigger to debug your routing system. Use generate : theme to create your new theme, feel free to install a profile right from your command-line interface or to use generate :config to set up your configuration, generate:entity :content, generate :bundle.Īnd by far the most commonly used of them is: debug: router a new rule: drupal generate:plugin: rulesactionįurthermore, it's not just modules and their various dependencies that you can generate using this Drupal Console command. All you need to do is answer the questions that the console's “setup wizard” will prompt you with.Īnd there's more! More than the boilerplate code that it'll provide you with for your “newly born” custom module. drupal generate:moduleĪnd I mean its name, path, dependencies, description. Just think about it: a simple command in the root of your Drupal 8 website and you get the whole scaffolding of your future custom module. The “Generate” Command: Create Your Own Custom Module I've carefully picked the 3 most powerful ones for “turbocharging” a developer's workflow:ĥ.1. What are the Drupal console commands that Drupal developers are most excited about? Those enabling this CLI to rival good old familiar Drush? To clear and rebuild all your cached data use: drush cache-rebuildĥ. If you want to first generate a list of all your caches, so you can select the ones to be cleared, just type: drush ccĮnter the number associated with the specific cache that you want to clear and press “Enter”. You always have Drush as an alternative to the user interface, for clearing or rebuilding your site's internal caches quick and easy: drush cache-clear While for exporting your config, just enter: drush cex Export and Import All Configurationsįor import, use this simple Drush command: drush cim The 2 most critical ones for your Drupal development process and Drupal management tasks:Ĥ.1. Now, from all the most useful Drupal development tasks that you can speed up using Drush commands, I've picked but 2. a low entry point to the otherwise steep Drupal 8 learning curve: it enables you to write more verbose code commentsīased on the Symfony Console library, Drupal Console can get installed, just like Drush, using Composer.įor it's those commands streamlining your tasks that help you pick your final “winner” in a “Drupal Console vs Drush” debate, right?.its functionality to generate boilerplate code: it takes no more than a few simple commands to create your custom entity type or custom module.The “new(er) kid on the block”, Drupal Console, comes to question the “Drush supremacy” as the go-to CLI for Drupal developers. Part of a PHP library, you can install it using Composer. they both boost your productivity as a Drupal developer by streamlining some otherwise time-consuming Drupal development and management tasksĪn only child in the Drupal ecosystem, Drush used to be the go-to command line for speeding up common tasks like:.they're both extensible you get to write your custom commands and to adapt the configuration files to your Drupal project's specific needs.they're both command-line tools that help you get a new Drupal website up and running in no time and keep interacting with your Drupal installation.Drupal Console vs Drush: What Do They Have in Common?īefore we dig out the differences - or better said “different ways of handling the same tasks“ - let's outline some of the obvious similarities between these tools: On one hand, you have good old Drush, with its familiar commands speeding up the most common Drupal development tasks.Īnd on the other hand, you have Drupal Console and the temptation of a newer CLI tool, along with its main strength: to generate the initial scaffolding for a new project.ġ. Those that would eventually help you choose the best CLI for you? When would you choose one over the other? And what would you base your choice on? What are their most powerful commands? In other words: do these 2 command-line tools (still) compliment each other? Can you run them together? And, if not, which one of them should you favor in a Drupal Console vs Drush "debate”?
0 Comments
Leave a Reply. |