HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/barbeatleanalyti/www/public_html/webmail/dev/docs/update-apigen.php
<?php
echo "Start documentation custom process \r\n";

include "parsedown.php";

$sDocsPath = dirname(__File__);
$sRootPath = dirname(dirname($sDocsPath));

$sMdFile = $sRootPath.'/apigen-overview.md';
$sDocsFile = $sRootPath.'/docs/api/index.html';


if (file_exists($sMdFile) && file_exists($sDocsFile))
{
	$sMdText = file_get_contents($sMdFile);
	
	$Parsedown = new Parsedown();
	$sOverviewtext = $Parsedown->text($sMdText);
	
	$sDoc = file_get_contents($sDocsFile);
	
	if ($sOverviewtext && $sDoc) 
	{
		$sDoc = preg_replace("/id=\"content\".*(?:\r)*(?:\n)*.*<\/h1>/", "$0" . $sOverviewtext, $sDoc);
		file_put_contents($sDocsFile, $sDoc);
		
		echo "Overview was saccessully added \r\n";
	}
	else
	{
		echo "Can't insert overview \r\n";
	}
}
else
{
	echo "apigen-overview.md or documentation not found \r\n";
}