ExtendedGitGraph
This commit is contained in:
parent
af09b49e8a
commit
114e93d09e
4
.gitignore
vendored
4
.gitignore
vendored
@ -5,4 +5,6 @@ runtime/
|
|||||||
**/.idea/workspace.xml
|
**/.idea/workspace.xml
|
||||||
**/.idea/tasks.xml
|
**/.idea/tasks.xml
|
||||||
|
|
||||||
**/.idea/dataSources*
|
**/.idea/dataSources*
|
||||||
|
|
||||||
|
config.php
|
1
www/internals/.gitignore
vendored
1
www/internals/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
config.php
|
|
@ -5,18 +5,16 @@ require_once (__DIR__ . '/../extern/egg/ExtendedGitGraph2.php');
|
|||||||
|
|
||||||
class MikescherGitGraph
|
class MikescherGitGraph
|
||||||
{
|
{
|
||||||
/**
|
/** @var ExtendedGitGraph2 */
|
||||||
* @return ExtendedGitGraph2
|
private $extgitgraph;
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public static function create()
|
|
||||||
{
|
|
||||||
global $CONFIG;
|
|
||||||
|
|
||||||
return new ExtendedGitGraph2($CONFIG['extendedgitgraph']);
|
/** @noinspection PhpUnhandledExceptionInspection */
|
||||||
|
public function __construct(Website $site)
|
||||||
|
{
|
||||||
|
$this->extgitgraph = new ExtendedGitGraph2($site->config['extendedgitgraph']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getPathRenderedData()
|
public function getPathRenderedData()
|
||||||
{
|
{
|
||||||
return __DIR__ . '/../dynamic/egg/cache_fullrenderer.html';
|
return __DIR__ . '/../dynamic/egg/cache_fullrenderer.html';
|
||||||
}
|
}
|
||||||
@ -25,16 +23,16 @@ class MikescherGitGraph
|
|||||||
* @return string|null
|
* @return string|null
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static function get()
|
public function get()
|
||||||
{
|
{
|
||||||
$d = self::create()->loadFromCache();
|
$d = $this->extgitgraph->loadFromCache();
|
||||||
if ($d === null) return "";
|
if ($d === null) return "";
|
||||||
return $d;
|
return $d;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function checkConsistency()
|
public function checkConsistency()
|
||||||
{
|
{
|
||||||
$p = self::getPathRenderedData();
|
$p =$this->getPathRenderedData();
|
||||||
|
|
||||||
if (!file_exists($p)) return ['result'=>'err', 'message' => 'Rendered data not found'];
|
if (!file_exists($p)) return ['result'=>'err', 'message' => 'Rendered data not found'];
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ class Website
|
|||||||
/** @var AlephNoteStatistics|null */ private $anstats = null;
|
/** @var AlephNoteStatistics|null */ private $anstats = null;
|
||||||
/** @var UpdatesLog|null */ private $updateslog = null;
|
/** @var UpdatesLog|null */ private $updateslog = null;
|
||||||
/** @var WebApps|null */ private $webapps = null;
|
/** @var WebApps|null */ private $webapps = null;
|
||||||
|
/** @var MikescherGitGraph|null */ private $extendedgitgraph = null;
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
@ -30,15 +31,8 @@ class Website
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->config = require (__DIR__ . "/config.php");
|
$this->config = require (__DIR__ . "/../config.php");
|
||||||
}
|
|
||||||
catch (exception $e)
|
|
||||||
{
|
|
||||||
$this->serveServerError("config.php not found", formatException($e), null);
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (!$this->config['prod'])
|
if (!$this->config['prod'])
|
||||||
{
|
{
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
@ -210,10 +204,16 @@ class Website
|
|||||||
|
|
||||||
public function WebApps(): WebApps
|
public function WebApps(): WebApps
|
||||||
{
|
{
|
||||||
if ($this->webapps === null) { require_once 'webapp.php'; $this->webapps = new WebApps(); }
|
if ($this->webapps === null) { require_once 'webapps.php'; $this->webapps = new WebApps(); }
|
||||||
return $this->webapps;
|
return $this->webapps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function ExtendedGitGraph(): MikescherGitGraph
|
||||||
|
{
|
||||||
|
if ($this->extendedgitgraph === null) { require_once 'mikeschergitgraph.php'; $this->extendedgitgraph = new MikescherGitGraph($this); }
|
||||||
|
return $this->extendedgitgraph;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user