1
0
www.mikescher.com/www/commands/extendedgitgraph_status.php

47 lines
1006 B
PHP
Raw Normal View History

2018-01-27 00:28:32 +01:00
<?php
2020-01-16 13:21:14 +01:00
require_once (__DIR__ . '/../internals/website.php');
2018-01-27 00:28:32 +01:00
2020-01-16 13:21:14 +01:00
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
/** @var URLRoute $ROUTE */ global $ROUTE;
/** @var Website $SITE */ global $SITE;
2019-12-28 14:00:11 +01:00
2020-01-16 13:21:14 +01:00
if ($SITE->config['extendedgitgraph']['output_file'])
2019-12-29 00:26:57 +01:00
{
2020-01-16 13:21:14 +01:00
$lfile = $SITE->config['extendedgitgraph']['output_filepath'];
2019-12-29 00:06:32 +01:00
2019-12-29 00:26:57 +01:00
if (file_exists($lfile))
{
$data = file_get_contents($lfile);
2019-12-29 00:06:32 +01:00
2019-12-29 00:26:57 +01:00
if ($data === '') echo '[[ EMPTY ]]';
else echo $data;
}
else
{
echo '[[ FILE NOT FOUND ]]';
}
}
2020-01-16 13:21:14 +01:00
else if ($SITE->config['extendedgitgraph']['output_file'])
2019-12-28 14:00:11 +01:00
{
2019-12-29 00:26:57 +01:00
if (session_status() !== PHP_SESSION_ACTIVE) session_start();
2020-01-16 13:21:14 +01:00
$svar = $SITE->config['extendedgitgraph']['session_var'];
2019-12-29 00:26:57 +01:00
if (isset($_GET['clear'])) if (key_exists($svar, $_SESSION)) $_SESSION[$svar] = '';
if (key_exists($svar, $_SESSION))
{
if ($_SESSION[$svar] === '') echo '[[ NO OUTPUT ]]';
else echo $_SESSION[$svar];
}
else
{
echo '[[ NO SESSION STARTED ]]';
}
2019-12-28 14:00:11 +01:00
}
2018-01-27 00:28:32 +01:00
else
2019-12-29 00:06:32 +01:00
{
2019-12-29 00:26:57 +01:00
echo '[[ NO USEFUL LOGGER CONFIGURED ]]';
2019-12-29 00:06:32 +01:00
}