connector.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Connector file for UpgradeMODX extra
  4. *
  5. * Copyright 2015-2018 by Bob Ray <https://bobsguides.com>
  6. * Created on 07-16-2018
  7. *
  8. * UpgradeMODX is free software; you can redistribute it and/or modify it under the
  9. * terms of the GNU General Public License as published by the Free Software
  10. * Foundation; either version 2 of the License, or (at your option) any later
  11. * version.
  12. *
  13. * UpgradeMODX is distributed in the hope that it will be useful, but WITHOUT ANY
  14. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  15. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along with
  18. * UpgradeMODX; if not, write to the Free Software Foundation, Inc., 59 Temple
  19. * Place, Suite 330, Boston, MA 02111-1307 USA
  20. *
  21. * @package upgrademodx
  22. */
  23. /* @var $modx modX */
  24. @include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/config.core.php';
  25. if (! defined('MODX_CORE_PATH')) {
  26. /* For development environment */
  27. require_once dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))))) . '/config.core.php';
  28. }
  29. require_once MODX_CORE_PATH . 'config/' . MODX_CONFIG_KEY . '.inc.php';
  30. require_once MODX_CONNECTORS_PATH . 'index.php';
  31. $upgrademodxCorePath = $modx->getOption('ugm.core_path', null, $modx->getOption('core_path') . 'components/upgrademodx/');
  32. require_once $upgrademodxCorePath . 'model/upgrademodx/upgrademodx.class.php';
  33. $modx->upgrademodx = new UpgradeMODX($modx);
  34. $modx->lexicon->load('upgrademodx:default');
  35. $path = $upgrademodxCorePath . 'processors/';
  36. /* handle request */
  37. $_SERVER['HTTP_MODAUTH'] = $modx->user->getUserToken('mgr');
  38. $modx->request->handleRequest(array(
  39. 'processors_path' => $path,
  40. 'location' => '',
  41. ));