You are here

function drd_server_svn_config_read in Drupal Remote Dashboard Server 6.2

Same name and namespace in other branches
  1. 7.2 drd_server_svn.module \drd_server_svn_config_read()

Return value

string

1 string reference to 'drd_server_svn_config_read'
drd_server_svn_xmlrpc in ./drd_server_svn.module
Implementation of hook_xmlrpc().

File

./drd_server_svn.module, line 146
Provides subversion functionality as an addition to drd_server.

Code

function drd_server_svn_config_read() {
  $args = func_get_args();
  $valid = _drd_server_validate_request($args);
  if ($valid !== TRUE) {
    return $valid;
  }
  $options = json_decode(array_shift($args));
  $directories = array();
  foreach ($options as $option) {
    $parts = explode(':', $option);
    $svn_modules = module_invoke($parts[0], 'drd_svn_module');
    if (empty($svn_modules[$parts[1]])) {
      return drd_server_error(t('No SVN definition available.'));
    }
    $directories[] = $svn_modules[$parts[1]];
  }
  $result = array(
    'directories' => $directories,
    'credentials' => array(
      'enabled' => variable_get('drd_server_svn_enabled', FALSE),
      'username' => variable_get('drd_server_svn_username', ''),
      'password' => variable_get('drd_server_svn_password', ''),
    ),
  );
  return drd_server_result('drd.config.svn.read', $result);
}