You are here

function htaccess_htaccess_deploy in Htaccess 7.2

Same name and namespace in other branches
  1. 8.2 htaccess.drush.inc \htaccess_htaccess_deploy()

Callback function for drush htaccess.

Parameters

$profile_name:

1 string reference to 'htaccess_htaccess_deploy'
htaccess_drush_command in ./htaccess.drush.inc
Implements hook_drush_command().

File

./htaccess.drush.inc, line 37

Code

function htaccess_htaccess_deploy($profile_name = NULL) {
  $profile_get = db_select('htaccess', 'h')
    ->fields('h')
    ->condition('name', array(
    ':profile_name' => $profile_name,
  ), 'IN')
    ->execute()
    ->fetchAssoc();
  if ($profile_get) {
    if (drush_confirm(dt('Are you sure you want to deploy the htaccess profile: @profile_name?', array(
      '@profile_name' => $profile_name,
    )), $indent = 0)) {
      $processing = htaccess_deploy_profile($profile_name);
      if ($processing == true) {
        drush_log(dt('Deploying htaccess @profile_name.', array(
          '@profile_name' => $profile_name,
        )), 'ok');
        drush_print(dt('Htaccess ' . $profile_name . ' has been deployed.', array(
          '@profile_name' => $profile_name,
        )));
      }
      else {
        drush_log(dt('Error during deployment.'), 'error');
      }
    }
    else {
      return;
    }
  }
  else {
    drush_log(dt('Profile @profile_name not found.', array(
      '@profile_name' => $profile_name,
    )), 'error');
  }
}