Drush for Developers - Second Edition
eBook - ePub

Drush for Developers - Second Edition

Juampy Novillo Requena

Compartir libro
  1. 180 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Drush for Developers - Second Edition

Juampy Novillo Requena

Detalles del libro
Vista previa del libro
Índice
Citas

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Drush for Developers - Second Edition un PDF/ePUB en línea?
Sí, puedes acceder a Drush for Developers - Second Edition de Juampy Novillo Requena en formato PDF o ePUB, así como a otros libros populares de Computer Science y Web Development. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2015
ISBN
9781784393786

Drush for Developers Second Edition


Table of Contents

Drush for Developers Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introduction, Installation, and Basic Usage
Installation requirements
Operating system
PHP
Installing Composer
Drush installation on Linux and OSX
Manual installation
The Drush command structure
Executing a command
Providing arguments to a command
Altering a command's behavior through options
Structuring command invocations
Command aliases
Understanding Drush's context system
Setting the context manually
Summary
2. Keeping Database Configuration and Code Together
Meeting the update path
Rebuilding the registry
Preparing the trap
Breaking the registry
Rebuilding Drupal's registry
Running database updates
Managing features
Exporting configuration into code
Running the update path on a different environment
Analyzing results
Reverting the feature components programmatically
Summary
3. Running and Monitoring Tasks in Drupal Projects
Running periodic tasks with cron
Disabling Drupal's cron
Verifying the current cron frequency
Overriding cron frequency and exporting it to code
Running cron with Drush
Scheduling cron runs with Jenkins
Installing Jenkins
Creating a job through the web interface
Monitoring cron runs
Running a task outside cron
Example – moving a Feeds importer from Drupal's cron to Drush
Exporting the Feeds importer into code
Writing a Drush command to trigger the Feeds importer
Running long tasks in batches
A sample Drush command using the Batch API
Batch API operations
Running the command and verifying the output
Evaluating code on the fly and running scripts
The php-eval command
The php-script command
A script to create nodes and revisions
Logging messages in Drush
The verbose and quiet modes
Redirecting Drush output into a file
Implementing your own logging mechanism
Running a command in the background
Summary
4. Error Handling and Debugging
Validating input
Validating an argument
Validating options
Ignoring options after the command name
Allowing additional options
Adding custom validation to a command
Rolling back when an error happens
Turning the update path into a single command
Browsing hook implementations
Inspecting the bootstrapping process
Inspecting hook and function implementations
Browsing and navigating hook implementations
Viewing source code of a function or method
Summary
5. Managing Local and Remote Environments
Managing local environments
Managing remote environments
Verifying requirements
Accessing a remote server through a public key
Defining a group of remote site aliases for our project
Using site aliases in commands
Special site aliases
Running a command on all site aliases of a group
Avoiding a Drupal bootstrap with @none
Referencing the current project with @self
Adding site alias support to the update path
Inspecting the command implementation and hooks
Running the update path with a site alias
Copying database and files between environments
Defining Drush shell aliases for a team
Blocking the execution of certain commands
Ignoring tables on sql-sync
Summary
6. Setting Up a Development Workflow
Moving configuration, commands, and site aliases out of Drupal
Installing Drupal Boilerplate
Relocating Drush files
Testing the new setup
Configuring the development database for the team
Configuring Jenkins to sync production to development
Fine-tuning the development database
Recreating the database on sql-sync
Excluding table data from production
Ignoring tables from production
Sanitizing data
Preventing e-mails from being sent
Running post sql-sync tasks in local environments
Summary
Index

Drush for Developers Second Edition

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2012
Second edition: January 2015
Production reference: 1240115
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-378-6
www.packtpub.com

Credits

Author
Juampy Novillo Requena
Reviewers
Greg Anderson
Chris Burgess
Jonathan Araña Cruz
Jeremy French
Todd Zebert
Commissioning Editor
Dipika Gaonkar
Acquisition Editor
Meeta Rajani
Content Development Editor
Anila Vincent
Technical Editor
Arvind Koul
Copy Editor
Relin Hedly
Project Coordinator
Neha Bhatnagar
Proofreaders
Bridget Braund
Ameesha Green
Indexer
Tejal Soni
Production Coordinator
Alwin Roy
Cover Work
Alwin Roy

About the Author

Juampy Novillo Requena started working as a web developer in London. After spending a few years developing with plain PHP, Symfony, and Ruby on Rails, he discovered Drupal. Drawn by the Drupal community and the mind-blowing effect of getting a project done 10 times faster than before, Juampy has never looked back.
Since then, he's become more and more involved in the issue queues, which in turn led him to become a maintainer of core and contributed modules. He organizes events, gives sessions at national and international conferences, and has written the book Drush User's Guide, Packt Publishing. He feels privileged to experiment, have fun, and be challenged every day. He is known as juampy on Drupal.org and IRC. His Twitter account is @juampy72.

Índice