Skip to content

Instantly share code, notes, and snippets.

@damiankloip
Created December 26, 2013 10:16
Show Gist options
  • Save damiankloip/8131971 to your computer and use it in GitHub Desktop.
Save damiankloip/8131971 to your computer and use it in GitHub Desktop.
#!/usr/bin/env php
<?php
/**
* @file
* Command line token calculator for rebuild.php.
*/
require_once __DIR__ . '/../vendor/autoload.php';
require_once dirname(__DIR__) . '/includes/bootstrap.inc';
use Drupal\Component\Utility\Crypt;
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
if (!drupal_is_cli()) {
exit;
}
$timestamp = time();
$token = Crypt::hmacBase64($timestamp, $drupal_hash_salt);
print "timestamp=$timestamp&token=$token\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment