You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
seacms-api/index.php

24 lines
653 B

<?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';
}