Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versioning? #29

Open
kylebrowning opened this issue Sep 22, 2015 · 0 comments
Open

Versioning? #29

kylebrowning opened this issue Sep 22, 2015 · 0 comments

Comments

@kylebrowning
Copy link
Contributor

WE need to be able to support version incase things change we don't want to break clients.

These are the current docs in D7

<?php
/**
 * @file
 * Explains how to use versions
 */

/*
 * All functions that want to be considered for updates need to use a specific naming convention
 * We took the same approach as the standard Drupal hook_update methods. The pattern of update functions is
 * _{RESOURCE_NAME}_resource_{METHOD_NAME}_update_{MAJOR_VERSION}_{MINOR_VERSION}
 * @see services_get_updates() for exact regular expression used.
 *
 * For clients that want to request a specific version they need to pass a certain header
 * services_RESOURCE_METHOD_version = version
 * as an example, services_system_set_variable_version = 1.2
 * @see ServicesVersionTests for code examples
 *
 * Services by default will always use the original resource shipped
 * with services. If you wish to change this you can go to the resource page,
 * and select an api version for the specific resource. The version option will
 * only be enabled if version changes exist.
 */

function _system_resource_set_variable_update_1_1() {
  $new_set = array(
    'help' => 'Create a node with an nid test',
  );
  return $new_set;
}

function _system_resource_set_variable_update_1_2() {
  $new_set = array(
    'help' => 'Create a node with an nid optional prams.',
    'args' => array(
      array(
        'name' => 'name',
        'optional' => TRUE,
        'source' => array('data' => 'name'),
        'description' => t('The name of the variable to set.'),
        'type' => 'string',
      ),
      array(
        'name' => 'value',
        'optional' => TRUE,
        'source' => array('data' => 'value'),
        'description' => t('The value to set.'),
        'type' => 'string',
      ),
    ),
  );
  return $new_set;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant