function hook_drush_sql_sync_sanitize

8.0.x drush.api.php hook_drush_sql_sync_sanitize($source)
6.x drush.api.php hook_drush_sql_sync_sanitize($source)
7.x drush.api.php hook_drush_sql_sync_sanitize($source)
4.x drush.api.php hook_drush_sql_sync_sanitize($source)
5.x drush.api.php hook_drush_sql_sync_sanitize($source)
master drush.api.php hook_drush_sql_sync_sanitize($source)

Sql-sync sanitization example. This is equivalent to the built-in --sanitize option of sql-sync, but simplified to only work with default values on Drupal 6 + mysql.

See also

sql_drush_sql_sync_sanitize().

1 function implements hook_drush_sql_sync_sanitize()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

sql_drush_sql_sync_sanitize in commands/sql/sync.sql.inc
Sql sync sanitization function. This hook function will sanitize usernames, passwords, and sessions when the --sanitize option is used. It is also an example of how to write a database sanitizer for sql sync.

File

docs/drush.api.php, line 269
Documentation of the Drush API.

Code

function hook_drush_sql_sync_sanitize($source) {
  drush_sql_register_post_sync_op('my-sanitize-id', dt('Reset passwords and email addresses in user table.'), "UPDATE users SET pass = MD5('password'), mail = concat('user+', uid, '@localhost') WHERE uid > 0;");
}