$result = $cache->get($cacheId);
$html = $result['html'] ?? null;
$response = $result['response'] ?? [];
// reconstruct the response configuration
if (empty($html) === false && empty($response) === false) {
$kirby->response()->fromArray($response);
}
}
// fetch the page regularly
if ($html === null) {
if ($contentType === 'html') {
$template = $this->template();
} else {
$template = $this->representation($contentType);
}
if ($template->exists() === false) {
throw new NotFoundException([
'key' => 'template.default.notFound'
]);
}
$kirby->data = $this->controller($data, $contentType);
// render the page
$html = $template->render($kirby->data);
// convert the response configuration to an array
$response = $kirby->response()->toArray();
// cache the result
if ($cache !== null && $kirby->response()->cache() === true) {
$cache->set($cacheId, [
'html' => $html,
'response' => $response
], $kirby->response()->expires() ?? 0);
}
}
// Empty input
if (empty($input) === true) {
return $this->io(new NotFoundException());
}
// Response Configuration
if (is_a($input, 'Kirby\Cms\Responder') === true) {
return $input->send();
}
// Responses
if (is_a($input, 'Kirby\Http\Response') === true) {
return $input;
}
// Pages
if (is_a($input, 'Kirby\Cms\Page')) {
try {
$html = $input->render();
} catch (ErrorPageException $e) {
return $this->io($e);
}
if ($input->isErrorPage() === true) {
if ($response->code() === null) {
$response->code(404);
}
}
return $response->send($html);
}
// Files
if (is_a($input, 'Kirby\Cms\File')) {
return $response->redirect($input->mediaUrl(), 307)->send();
}
// Simple HTML response
if (is_string($input) === true) {
$scriptName = $_SERVER['SCRIPT_NAME'];
$scriptFile = basename($scriptName);
$scriptDir = dirname($scriptName);
$scriptPath = $scriptFile === 'index.php' ? $scriptDir : $scriptName;
$requestPath = preg_replace('!^' . preg_quote($scriptPath) . '!', '', $requestUri);
return $this->setPath($requestPath)->path;
}
/**
* Returns the Response object for the
* current request
*
* @param string|null $path
* @param string|null $method
* @return \Kirby\Http\Response
*/
public function render(string $path = null, string $method = null)
{
return $this->io($this->call($path, $method));
}
/**
* Returns the Request singleton
*
* @return \Kirby\Http\Request
*/
public function request()
{
return $this->request = $this->request ?? new Request();
}
/**
* Path resolver for the router
*
* @internal
* @param string|null $path
* @param string|null $language
* @return mixed
* @throws \Kirby\Exception\NotFoundException if the home page cannot be found
<?php
header('Access-Control-Allow-Origin: *');
header('HTTP/1.1 200 OK');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Methods: GET, HEAD, OPTIONS, POST, PUT');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization');
header('Content-type: application/json; charset=utf-8');
require './kirby/bootstrap.php';
echo (new Kirby)->render();
Key | Value |
USER | cms.javelincommoditi_7fi5i52z50s |
HOME | /var/www/vhosts/cms.javelincommodities.com |
SCRIPT_NAME | /index.php |
REQUEST_URI | /commodities-trading/oil-and-refined-products |
QUERY_STRING | |
REQUEST_METHOD | GET |
SERVER_PROTOCOL | HTTP/1.0 |
GATEWAY_INTERFACE | CGI/1.1 |
REDIRECT_URL | /commodities-trading/oil-and-refined-products |
REMOTE_PORT | 53646 |
SCRIPT_FILENAME | /var/www/vhosts/cms.javelincommodities.com/httpdocs/index.php |
SERVER_ADMIN | [no address given] |
CONTEXT_DOCUMENT_ROOT | /var/www/vhosts/cms.javelincommodities.com/httpdocs |
CONTEXT_PREFIX | |
REQUEST_SCHEME | https |
DOCUMENT_ROOT | /var/www/vhosts/cms.javelincommodities.com/httpdocs |
REMOTE_ADDR | 3.235.60.197 |
SERVER_PORT | 443 |
SERVER_ADDR | 209.97.134.137 |
SERVER_NAME | cms.javelincommodities.com |
SERVER_SOFTWARE | Apache |
SERVER_SIGNATURE | <address>Apache Server at cms.javelincommodities.com Port 443</address> |
PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin |
HTTP_ACCEPT_ENCODING | br,gzip |
HTTP_ACCEPT_LANGUAGE | en-US,en;q=0.5 |
HTTP_ACCEPT | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
HTTP_USER_AGENT | CCBot/2.0 (https://commoncrawl.org/faq/) |
HTTP_CONNECTION | close |
HTTP_X_ACCEL_INTERNAL | /internal-nginx-static-location |
HTTP_X_REAL_IP | 3.235.60.197 |
HTTP_HOST | cms.javelincommodities.com |
proxy-nokeepalive | 1 |
HTTPS | on |
PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY | 0 |
PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY | 0 |
HTTP_AUTHORIZATION | |
SCRIPT_URI | https://cms.javelincommodities.com/commodities-trading/oil-and-refined-products |
SCRIPT_URL | /commodities-trading/oil-and-refined-products |
UNIQUE_ID | ZXRz4kkv8IsTkGKC7vE8twAAAFI |
REDIRECT_STATUS | 200 |
REDIRECT_HTTPS | on |
REDIRECT_PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY | 0 |
REDIRECT_PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY | 0 |
REDIRECT_HTTP_AUTHORIZATION | |
REDIRECT_SCRIPT_URI | https://cms.javelincommodities.com/commodities-trading/oil-and-refined-products |
REDIRECT_SCRIPT_URL | /commodities-trading/oil-and-refined-products |
REDIRECT_UNIQUE_ID | ZXRz4kkv8IsTkGKC7vE8twAAAFI |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1702130658.6132 |
REQUEST_TIME | 1702130658 |