You are here

function system_service_service in Services 6.2

Same name and namespace in other branches
  1. 5 services/system_service/system_service.module \system_service_service()
  2. 6 services/system_service/system_service.module \system_service_service()
  3. 7 services/system_service/system_service.module \system_service_service()

Implementation of hook_service().

File

services/system_service/system_service.module, line 25
Link general system functionalities to services module.

Code

function system_service_service() {
  return array(
    // system.connect
    array(
      '#method' => 'system.connect',
      '#callback' => 'system_service_connect',
      '#access callback' => 'services_access_menu',
      '#file' => array(
        'file' => 'inc',
        'module' => 'system_service',
      ),
      '#return' => 'struct',
      '#help' => t('Returns an object containing a sessid and user.'),
    ),
    // system.mail
    array(
      '#method' => 'system.mail',
      '#callback' => 'system_service_mailprepare',
      '#access arguments' => array(
        'send mail from remote',
      ),
      '#file' => array(
        'file' => 'inc',
        'module' => 'system_service',
      ),
      '#args' => array(
        array(
          '#name' => 'mailkey',
          '#type' => 'string',
          '#description' => t('A key to identify the mail sent, for altering.'),
        ),
        array(
          '#name' => 'to',
          '#type' => 'string',
          '#description' => t('The mail address or addresses where the message will be send to.'),
        ),
        array(
          '#name' => 'subject',
          '#type' => 'string',
          '#description' => t('Subject of the e-mail to be sent. This must not contain any newline characters, or the mail may not be sent properly.'),
        ),
        array(
          '#name' => 'body',
          '#type' => 'string',
          '#description' => t('Message to be sent. Drupal will format the correct line endings for you.'),
        ),
        array(
          '#name' => 'from',
          '#type' => 'string',
          '#optional' => TRUE,
          '#description' => t('Sets From, Reply-To, Return-Path and Error-To to this value, if given.'),
        ),
        array(
          '#name' => 'headers',
          '#type' => 'array',
          '#optional' => TRUE,
          '#description' => t('Associative array containing the headers to add. This is typically used to add extra headers (From, Cc, and Bcc).'),
        ),
      ),
      '#return' => 'struct',
      '#help' => t('Send an e-mail message, using Drupal variables and default settings.'),
    ),
    // system.getVariable
    array(
      '#method' => 'system.getVariable',
      '#callback' => 'system_service_getvariable',
      '#access arguments' => array(
        'get variable from remote',
      ),
      '#file' => array(
        'file' => 'inc',
        'module' => 'system_service',
      ),
      '#args' => array(
        array(
          '#name' => 'name',
          '#type' => 'string',
          '#description' => t('The name of the variable to return.'),
        ),
        array(
          '#name' => 'default',
          '#type' => 'string',
          '#optional' => TRUE,
          '#description' => t('The default value to use if this variable has never been set.'),
        ),
      ),
      '#return' => 'string',
      '#help' => t('Return a persistent variable.'),
    ),
    // system.setVariable
    array(
      '#method' => 'system.setVariable',
      '#callback' => 'system_service_setvariable',
      '#access arguments' => array(
        'set variable from remote',
      ),
      '#file' => array(
        'file' => 'inc',
        'module' => 'system_service',
      ),
      '#args' => array(
        array(
          '#name' => 'name',
          '#type' => 'string',
          '#description' => t('The name of the variable to set.'),
        ),
        array(
          '#name' => 'value',
          '#type' => 'string',
          '#description' => t('The value to set.'),
        ),
      ),
      '#help' => t('Set a persistent variable.'),
    ),
    // system.moduleExists
    array(
      '#method' => 'system.moduleExists',
      '#callback' => 'system_service_module_exists',
      '#access arguments' => array(
        'check module exists from remote',
      ),
      '#file' => array(
        'file' => 'inc',
        'module' => 'system_service',
      ),
      '#args' => array(
        array(
          '#name' => 'module',
          '#type' => 'string',
          '#description' => t('The name of the module.'),
        ),
      ),
      '#return' => 'string',
      '#help' => t('Check if a module is enabled. If so, return its version.'),
    ),
    // system.getServices
    array(
      '#method' => 'system.getServices',
      '#callback' => 'system_service_getservices',
      '#access arguments' => array(
        'get available services',
      ),
      '#file' => array(
        'file' => 'inc',
        'module' => 'system_service',
      ),
      '#return' => 'struct',
      '#help' => t('Returns an object containing all the available services.'),
    ),
    // system.cacheClearAll
    array(
      '#method' => 'system.cacheClearAll',
      '#callback' => 'system_service_cache_clear_all',
      '#access arguments' => array(
        'clear cache from remote',
      ),
      '#file' => array(
        'file' => 'inc',
        'module' => 'system_service',
      ),
      '#args' => array(),
      '#return' => 'bool',
      '#help' => t('Clear cache on remote site.'),
    ),
    // system.watchdog
    array(
      '#method' => 'system.watchdog',
      '#callback' => 'system_service_watchdog_send',
      '#access arguments' => array(
        'log a system message from remote',
      ),
      '#file' => array(
        'file' => 'inc',
        'module' => 'system_service',
      ),
      '#args' => array(
        array(
          '#name' => 'type',
          '#type' => 'string',
          '#description' => t('The category to which this message belongs.'),
        ),
        array(
          '#name' => 'message',
          '#type' => 'string',
          '#description' => t('The message to store in the log. See t() for documentation on how $message and $variables interact. Keep $message translatable by not concatenating dynamic values into it!'),
        ),
        array(
          '#name' => 'variables',
          '#type' => 'array',
          '#optional' => TRUE,
          '#description' => t('Array of variables to replace in the message on display or NULL if message is already translated or not possible to translate.'),
        ),
        array(
          '#name' => 'severity',
          '#type' => 'int',
          '#optional' => TRUE,
          '#description' => t('The severity of the message, as per RFC 3164.'),
        ),
        array(
          '#name' => 'link',
          '#type' => 'string',
          '#optional' => TRUE,
          '#description' => t('A link to associate with the message.'),
        ),
      ),
      '#return' => 'bool',
      '#help' => t('Log a system message.'),
    ),
  );
}