Skip to content

Commit

Permalink
Merge pull request civicrm#19795 from MJCO/resetPathsAPI4
Browse files Browse the repository at this point in the history
Add `resetPaths` as per issue civicrm#2458 #1
  • Loading branch information
eileenmcnaughton authored Mar 14, 2021
2 parents 536d35f + cfab3bd commit da28128
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Civi/Api4/Action/System/ResetPaths.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/*
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC. All rights reserved. |
| |
| This work is published under the GNU AGPLv3 license with some |
| permitted exceptions and without any warranty. For full license |
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/

namespace Civi\Api4\Action\System;

/**
* Reset paths using doSiteMove().
*/
class ResetPaths extends \Civi\Api4\Generic\AbstractAction {

public function _run(\Civi\Api4\Generic\Result $result) {
\CRM_Core_BAO_ConfigSetting::doSiteMove();
}

}
9 changes: 9 additions & 0 deletions Civi/Api4/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,13 @@ public static function getFields($checkPermissions = TRUE) {
}))->setCheckPermissions($checkPermissions);
}

/**
* @param bool $checkPermissions
* @return Action\System\ResetPaths
*/
public static function resetPaths($checkPermissions = TRUE) {
return (new Action\System\ResetPaths(__CLASS__, __FUNCTION__))
->setCheckPermissions($checkPermissions);
}

}

0 comments on commit da28128

Please sign in to comment.