You are here

function system_service_service in Services 5

Same name and namespace in other branches
  1. 6 services/system_service/system_service.module \system_service_service()
  2. 6.2 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
The module which exposes services related to system activies

Code

function system_service_service() {
  return array(
    // system.connect
    array(
      '#method' => 'system.connect',
      '#callback' => 'system_service_connect',
      '#key' => FALSE,
      '#auth' => FALSE,
      '#return' => 'struct',
      '#help' => t('Returns an object containing a sessid and user.'),
    ),
    // system.mail
    array(
      '#method' => 'system.mail',
      '#callback' => 'system_service_mail',
      '#access arguments' => array(
        'send mail from remote',
      ),
      '#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',
      ),
      '#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',
      ),
      '#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',
      ),
      '#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.'),
    ),
  );
}