#!/usr/bin/env php " Example: {$script} "mynewpassword" All arguments are long options. --help Print this page. "" ["" ["" ...]] One or more plan-text passwords enclosed by double quotes. The output hash may be manually entered into the {users}.pass field to change a password via SQL to a known value. EOF; exit; } // Password list to be processed. $passwords = $_SERVER['argv']; $core = dirname(__DIR__); require_once $core . '/vendor/autoload.php'; require_once $core . '/includes/bootstrap.inc'; // Bootstrap the code so we have the container. drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION); $kernel = new DrupalKernel('prod', drupal_classloader(), FALSE); $kernel->boot(); $password_hasher = $kernel->getContainer()->get('password'); foreach ($passwords as $password) { print("\npassword: $password \t\thash: ". $password_hasher->hash($password) ."\n"); } print("\n");