#!/usr/bin/php > /passwd\n\n"); } function xcvs_init($argc, $argv) { $this_file = array_shift($argv); // argv[0] $config_file = array_shift($argv); // argv[1] if ($argc < 2) { xcvs_help($this_file, STDERR); exit(3); } // Load the configuration file and bootstrap Drupal. if (!file_exists($config_file)) { fwrite(STDERR, "Error: failed to load configuration file.\n"); exit(4); } include_once $config_file; // Do a full Drupal bootstrap. xcvs_bootstrap($xcvs); $repository = versioncontrol_get_repository($xcvs['repo_id']); if (!isset($repository)) { fwrite(STDERR, "The repository corresponding to the configured repo id could not be loaded.\n"); exit(1); } // Set the Drupal base path, so that url() returns a proper URL. global $base_url; $base_url = DRUPAL_SITE; // Do the export! fwrite(STDOUT, versioncontrol_export_accounts($repository)); exit(0); } xcvs_init($argc, $argv);