24 lines
653 B
PHP
24 lines
653 B
PHP
<?php
|
|
|
|
/**
|
|
* SPDX-License-Identifier: EUPL-1.2
|
|
* Authors: see /README.md
|
|
*/
|
|
|
|
use SeaCMS\Api\JsonResponse;
|
|
|
|
$end = 'vendor/picocms/plugins/SeacmsApi/index.php';
|
|
if (empty($_SERVER['SCRIPT_NAME']) ||
|
|
empty($_SERVER['SCRIPT_FILENAME']) ||
|
|
substr($_SERVER['SCRIPT_NAME'],-strlen($end)) != $end){
|
|
|
|
if (!class_exists(JsonResponse::class,false)){
|
|
include_once __DIR__.'/src/JsonResponse.php';
|
|
}
|
|
|
|
echo (new JsonResponse(500,['code'=>500,'reason'=>'bad url to run this file']))->send();
|
|
} else {
|
|
chdir(dirname($_SERVER['SCRIPT_FILENAME'],5));
|
|
$GLOBALS['PicoVendorsDirectoryRelativeLevels'] = 4;
|
|
include 'index.php';
|
|
} |