售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
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
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜