Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I wrote some lines for drush support in path_redirect. Enjoy.
drush pathredirect-add src dst
Comment | File | Size | Author |
---|---|---|---|
#2 | path_redirect.drush_.inc_.zip | 1.78 KB | David Hernández |
#1 | path_redirect.drush_.inc_.gz | 270 bytes | okokokok |
Comments
Comment #1
okokokok CreditAttribution: okokokok commentedComment #2
David Hernández CreditAttribution: David Hernández commentedHi!
I've updated the code provided by Kasper Souren to follow the Drupal Coding Standards and added command aliases. Also, I've added two new commands:
I've tested the part of Kasper Souren and was working fine. My part works to but I will leave it for review.
Regards,
David.
Comment #3
David Hernández CreditAttribution: David Hernández commentedChanged to version 6.x-1.x-dev
Comment #4
tomotomo CreditAttribution: tomotomo commentedWhat's the right way to get a .drush.inc file included?
Also, how about a "path-redirect-list" command? :)
Comment #5
David Hernández CreditAttribution: David Hernández commentedHello,
#4, Drush loads the [module name].drush.inc file included in the folder of the module or inside a drush folder, so you don't have to worry about including or loading the new drush commands.
A path redirect list command will be easy to implement, but I'm not sure if it's a good idea as you may have a lot of redirects. Maybe adding some filters to the command will help, for example adding a limit to the query, filtering by redirect type... The module provides a function to load a list of redirects using different parameters (path_redirect_list_redirects), but maybe will need a bit of refactoring to work with drush.
I will try to have a better look in other moment.
Regards,
David.
Comment #6
tomotomo CreditAttribution: tomotomo commentedI think that hundreds of entries is not a problem, but thousands of entries would generally need to be redirected to a file. If not listing output to stdout, then maybe "path-redirect-export" should be an option.