Move plugin files to a subfolder

[MAILPOET-3988]
This commit is contained in:
Jan Jakes
2022-01-13 14:46:43 +01:00
committed by Veljko V
parent d2016701ee
commit 9f790efbf0
3200 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,41 @@
<?php
namespace MailPoet\API\JSON\v1;
use MailPoet\API\JSON\Endpoint as APIEndpoint;
use MailPoet\Config\AccessControl;
use MailPoet\Config\Activator;
use MailPoet\WP\Functions as WPFunctions;
class Setup extends APIEndpoint {
public $permissions = [
'global' => AccessControl::PERMISSION_MANAGE_SETTINGS,
];
/** @var WPFunctions */
private $wp;
/** @var Activator */
private $activator;
public function __construct(
WPFunctions $wp,
Activator $activator
) {
$this->wp = $wp;
$this->activator = $activator;
}
public function reset() {
try {
$this->activator->deactivate();
$this->activator->activate();
$this->wp->doAction('mailpoet_setup_reset');
return $this->successResponse();
} catch (\Exception $e) {
return $this->errorResponse([
$e->getCode() => $e->getMessage(),
]);
}
}
}