Last active
August 29, 2015 13:56
-
-
Save Sanchiz/8828278 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
module_load_include('inc', 'ctools', 'includes/export'); | |
// Load base enpoint and adding config for new subsite. | |
$base_taxonomy_endpoint = multisite_indicator_server_deploy_endpoints_default(); | |
$endpoint = $base_taxonomy_endpoint['base_taxonomy_endpoint']; | |
$endpoint_url = $term->field_domain[LANGUAGE_NONE][0]['url'] . '/' . $endpoint->service_config['url']; | |
// Create machine name. | |
$endpoint->name = 'taxonomy_sync_' . preg_replace('@[^a-z0-9-]+@', '_', strtolower(drupal_strtolower($term->name))); | |
$endpoint->title = $endpoint->name; | |
$endpoint->description = t('Deployment taxonomy changes to @site site with services URL: @link', array('@site' => $term->name, '@link' => $endpoint_url)); | |
$endpoint->export_type = NULL; | |
$endpoint->service_config['url'] = $endpoint_url; | |
// @TODO Set user from subsite endpoint. | |
$endpoint->authenticator_config = array( | |
'username' => 'username', | |
'password' => 'password', | |
); | |
ctools_export_crud_save('deploy_endpoints', $endpoint); | |
// Add endpoint to deployment plan. | |
$deploy_plan = ctools_export_crud_load('deploy_plans', 'taxonomy_sync'); | |
$deploy_plan->endpoints[$endpoint->name] = $endpoint->name; | |
ctools_export_crud_save('deploy_plans', $deploy_plan); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment