Merge pull request #17023 from civicrm/5.25
[civicrm-core.git] / bin / migrate / export.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
6b7eb9df 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 5 | |
6b7eb9df
TO
6 | Use of this source code is governed by the AGPL license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
6a488035 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
6a488035
TO
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
16 */
17function run() {
18 session_start();
19
20 require_once '../../civicrm.config.php';
21 require_once 'CRM/Core/Config.php';
22 $config = CRM_Core_Config::singleton();
23
24 // this does not return on failure
25 CRM_Utils_System::authenticateScript(TRUE);
202e2654
TO
26 if (!CRM_Core_Permission::check('administer CiviCRM')) {
27 CRM_Utils_System::authenticateAbort("User does not have required permission (administer CiviCRM).\n", TRUE);
28 }
6a488035
TO
29
30 require_once 'CRM/Utils/Migrate/Export.php';
31 $export = new CRM_Utils_Migrate_Export();
8575f879
TO
32 $export->build();
33 CRM_Utils_System::download('CustomGroupData.xml', 'text/plain', $export->toXML());
6a488035
TO
34}
35
36run();