2023-10-17 18:09:30 +02:00
< html >
< head >
< meta http - equiv = " Content-Type " content = " text/html; charset=UTF-8 " />
</ head >
< body >
< pre > <!-- Keep pure text line breaks -->
< ? php
2023-12-10 19:42:23 +01:00
$autoloadPath = '/home/meeehgru/vendor/autoload.php' ;
2023-10-17 18:09:30 +02:00
2023-12-10 19:42:23 +01:00
// Check if autoload.php file exists
if ( ! file_exists ( $autoloadPath )) {
echo " <p>PHP Configuration changed. The autoload.php file is missing. Please run <code>composer install</code> or <code>composer require vstelmakh/url-highlight</code>. Please inform the osamc.de staff about this problem.</p> " ;
2023-12-10 19:50:53 +01:00
exit ; // Stop script execution
2023-10-17 18:09:30 +02:00
}
2023-12-10 19:42:23 +01:00
2023-12-10 19:50:53 +01:00
require $autoloadPath ;
// Check if UrlHighlight class exists using its fully qualified name
if ( ! class_exists ( 'VStelmakh\UrlHighlight\UrlHighlight' )) {
echo " <p>PHP Configuration changed. Run <code>composer require vstelmakh/url-highlight</code>. Please inform the osamc.de staff about this problem.</p> " ;
exit ; // Stop script execution
}
// Now we can use the use statement
use VStelmakh\UrlHighlight\UrlHighlight ;
// Main logic of the script starts here
$urlHighlight = new UrlHighlight ();
$files = glob ( " ./protokolle/osamc_*.txt " );
foreach ( array_reverse ( $files ) as $file ){
$path_parts = pathinfo ( $file );
echo " <h2> " . $path_parts [ 'filename' ] . " </h2> " ;
echo " \n " ;
echo $urlHighlight -> highlightUrls ( file_get_contents ( $file ));
echo " \n " ;
}
// Remove fclose($out); as $out is not defined
2023-10-17 18:09:30 +02:00
?>
</ pre >
</ body >
</ html >