Merge branch 'release/v28.1.1.OS'
This commit is contained in:
@@ -1,7 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
include ('config.php');
|
include ('config.php');
|
||||||
if (isset($_REQUEST['method']) && isset($_REQUEST['url'])) {
|
include (APP_BASE_PATH.'rest.php');
|
||||||
include (APP_BASE_PATH.'api.php');
|
|
||||||
} else {
|
|
||||||
include (APP_BASE_PATH.'rest.php');
|
|
||||||
}
|
|
||||||
|
|||||||
47
core/api-rest.php
Normal file
47
core/api-rest.php
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
define('CLIENT_PATH',dirname(__FILE__));
|
||||||
|
include ("config.base.php");
|
||||||
|
include ("include.common.php");
|
||||||
|
include("server.includes.inc.php");
|
||||||
|
|
||||||
|
if(\Classes\SettingsManager::getInstance()->getSetting('Api: REST Api Enabled') == '1') {
|
||||||
|
|
||||||
|
if (defined('SYM_CLIENT')) {
|
||||||
|
define('REST_API_PATH', '/'.SYM_CLIENT.'/');
|
||||||
|
} else if (!defined('REST_API_PATH')){
|
||||||
|
define('REST_API_PATH', '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
\Utils\LogManager::getInstance()->info("Request: " . $_REQUEST);
|
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||||||
|
http_response_code(200);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$echoRoute = \Classes\Macaw::get(REST_API_PATH . 'echo', function () {
|
||||||
|
echo "Echo " . rand();
|
||||||
|
});
|
||||||
|
|
||||||
|
\Utils\LogManager::getInstance()->debug('Api registered URI: '.$echoRoute);
|
||||||
|
|
||||||
|
$moduleManagers = \Classes\BaseService::getInstance()->getModuleManagers();
|
||||||
|
|
||||||
|
foreach ($moduleManagers as $moduleManagerObj) {
|
||||||
|
|
||||||
|
$moduleManagerObj->setupRestEndPoints();
|
||||||
|
}
|
||||||
|
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||||
|
$method = $_SERVER['REQUEST_METHOD'];
|
||||||
|
\Utils\LogManager::getInstance()->debug('Api dispatch URI: '.$uri);
|
||||||
|
\Utils\LogManager::getInstance()->debug('Api dispatch method: '.$uri);
|
||||||
|
if (!defined('SYM_CLIENT')) {
|
||||||
|
//For hosted installations, dispatch will be done in app/index
|
||||||
|
\Classes\Macaw::dispatch();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
echo "REST Api is not enabled. Please set 'Api: REST Api Enabled' setting to true";
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ if(!defined('HOME_LINK_OTHERS')){
|
|||||||
|
|
||||||
//Version
|
//Version
|
||||||
define('VERSION', '28.1.1.OS');
|
define('VERSION', '28.1.1.OS');
|
||||||
define('CACHE_VALUE', '28.1.1.OS.2020-11071142');
|
define('CACHE_VALUE', '28.1.1.OS.2020-11071143');
|
||||||
define('VERSION_NUMBER', '280101');
|
define('VERSION_NUMBER', '280101');
|
||||||
define('VERSION_DATE', '07/11/2020');
|
define('VERSION_DATE', '07/11/2020');
|
||||||
|
|
||||||
|
|||||||
@@ -3,49 +3,8 @@ header('Access-Control-Allow-Origin: *');
|
|||||||
header('Access-Control-Allow-Methods: DELETE, POST, GET, OPTIONS');
|
header('Access-Control-Allow-Methods: DELETE, POST, GET, OPTIONS');
|
||||||
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
|
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
define('CLIENT_PATH',dirname(__FILE__));
|
if (isset($_REQUEST['method']) && isset($_REQUEST['url'])) {
|
||||||
include ("config.base.php");
|
include(APP_BASE_PATH . 'api-url-based.php');
|
||||||
include ("include.common.php");
|
} else {
|
||||||
include("server.includes.inc.php");
|
include(APP_BASE_PATH . 'api-rest.php');
|
||||||
|
|
||||||
if(\Classes\SettingsManager::getInstance()->getSetting('Api: REST Api Enabled') == '1') {
|
|
||||||
|
|
||||||
if (defined('SYM_CLIENT')) {
|
|
||||||
define('REST_API_PATH', '/'.SYM_CLIENT.'/');
|
|
||||||
} else if (!defined('REST_API_PATH')){
|
|
||||||
define('REST_API_PATH', '/');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
\Utils\LogManager::getInstance()->info("Request: " . $_REQUEST);
|
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
|
||||||
http_response_code(200);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$echoRoute = \Classes\Macaw::get(REST_API_PATH . 'echo', function () {
|
|
||||||
echo "Echo " . rand();
|
|
||||||
});
|
|
||||||
|
|
||||||
\Utils\LogManager::getInstance()->debug('Api registered URI: '.$echoRoute);
|
|
||||||
|
|
||||||
$moduleManagers = \Classes\BaseService::getInstance()->getModuleManagers();
|
|
||||||
|
|
||||||
foreach ($moduleManagers as $moduleManagerObj) {
|
|
||||||
|
|
||||||
$moduleManagerObj->setupRestEndPoints();
|
|
||||||
}
|
|
||||||
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
|
||||||
$method = $_SERVER['REQUEST_METHOD'];
|
|
||||||
\Utils\LogManager::getInstance()->debug('Api dispatch URI: '.$uri);
|
|
||||||
\Utils\LogManager::getInstance()->debug('Api dispatch method: '.$uri);
|
|
||||||
if (!defined('SYM_CLIENT')) {
|
|
||||||
//For hosted installations, dispatch will be done in app/index
|
|
||||||
\Classes\Macaw::dispatch();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}else{
|
|
||||||
echo "REST Api is not enabled. Please set 'Api: REST Api Enabled' setting to true";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class IceApiClient {
|
|||||||
|
|
||||||
get(endpoint) {
|
get(endpoint) {
|
||||||
if (this.legacyApiWrapper) {
|
if (this.legacyApiWrapper) {
|
||||||
const url = `${this.clientBaseUrl}rest.php?token=${this.token}&method=get&url=/${endpoint}`;
|
const url = `${this.clientBaseUrl}api/index.php?token=${this.token}&method=get&url=/${endpoint}`;
|
||||||
return axios.get(url);
|
return axios.get(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
web/dist/admin-bundle.js
vendored
2
web/dist/admin-bundle.js
vendored
File diff suppressed because one or more lines are too long
4
web/dist/common.js
vendored
4
web/dist/common.js
vendored
File diff suppressed because one or more lines are too long
4
web/dist/modules-bundle.js
vendored
4
web/dist/modules-bundle.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user