This page is archived
We're keeping this page up as a courtesy to folks who may need to refer to old instructions. We don't plan to update this page.
Create a custom Drush command, which makes use of re-usable functions within our Movie Import module.
Goal
Create a custom Drush command that will run a movie import function in our custom module.
Prerequisites
You will need the following knowledge and skills. If you need a review, check out the Additional resources section at the bottom of this page.
- How to create a custom Drush command for importing content.
Tasks
Write a Drush command in the movie_import custom module, which imports all the films defined in the variable created in the .install file.
Write a Drush command which deletes all movies in the website.
Recap
- Drush commands allow us to run time-consuming processes without timing out.
- Drush commands can be used within shell scripts, for example to manage releases of Drupal.
Further your understanding
- Continue to the next lesson: Movie Project: Create an Administration Form.
Additional resources
- Drush.org documentation (drush.org)
- Video: Coding for Drush series (Drupalize.Me)