Adds MP API facade
This commit is contained in:
15
lib/API/MP/API.php
Normal file
15
lib/API/MP/API.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace MailPoet\MP\API;
|
||||
|
||||
if(!defined('ABSPATH')) exit;
|
||||
|
||||
class API {
|
||||
static function __callStatic($version, $arguments) {
|
||||
$api_class = sprintf('%s\%s\API', __NAMESPACE__, $version);
|
||||
if(class_exists($api_class)) {
|
||||
$api = new $api_class();
|
||||
return $api;
|
||||
}
|
||||
throw new \Exception(__('Invalid API version.', 'mailpoet'));
|
||||
}
|
||||
}
|
7
lib/API/MP/v1/API.php
Normal file
7
lib/API/MP/v1/API.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
namespace MailPoet\API\MP\v1;
|
||||
|
||||
if(!defined('ABSPATH')) exit;
|
||||
|
||||
class API {
|
||||
}
|
Reference in New Issue
Block a user