You are here

function optimizely_set_id in Optimizely 7.3

Callback function for optimizely-set-id command.

@parm $oid An oid provided by Optimizely and entered via drush. Must be an integer.

1 string reference to 'optimizely_set_id'
optimizely_drush_command in ./optimizely.drush.inc
Implements hook_drush_command().

File

./optimizely.drush.inc, line 51
Drush integration of Otimizely.

Code

function optimizely_set_id($oid = NULL) {
  module_load_include('inc', 'optimizely', 'optimizely.admin');
  if (empty($oid)) {
    return drush_set_error(dt('The ID of the Optimizely account is required.'));
  }
  if (!preg_match('/^\\d+$/', $oid)) {
    return drush_set_error(dt('Invalid Optimizely ID, needs to be numeric.'));
  }
  _optimizely_update_oid($oid);
  drush_log(dt('The Optimizely ID was set to @oid. The default project entry is now ready to be enabled. This will apply to the default Optimizely project tests site wide.', array(
    '@oid' => $oid,
  )), 'ok');
}