mirror of https://codeberg.org/Sonoj/osamc.de
repair the repair
This commit is contained in:
parent
095136c5df
commit
6742e702ee
|
@ -11,28 +11,33 @@ $autoloadPath = '/home/meeehgru/vendor/autoload.php';
|
||||||
// Check if autoload.php file exists
|
// Check if autoload.php file exists
|
||||||
if (!file_exists($autoloadPath)) {
|
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>";
|
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>";
|
||||||
} else {
|
exit; // Stop script execution
|
||||||
require $autoloadPath;
|
}
|
||||||
|
|
||||||
// Check if UrlHighlight class exists
|
require $autoloadPath;
|
||||||
if (!class_exists(\VStelmakh\UrlHighlight\UrlHighlight::class)) {
|
|
||||||
|
// 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>";
|
echo "<p>PHP Configuration changed. Run <code>composer require vstelmakh/url-highlight</code>. Please inform the osamc.de staff about this problem.</p>";
|
||||||
} else {
|
exit; // Stop script execution
|
||||||
// Your existing code goes here
|
}
|
||||||
use VStelmakh\UrlHighlight\UrlHighlight;
|
|
||||||
$urlHighlight = new UrlHighlight();
|
|
||||||
|
|
||||||
$files = glob("./protokolle/osamc_*.txt");
|
// Now we can use the use statement
|
||||||
foreach(array_reverse($files) as $file){
|
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);
|
$path_parts = pathinfo($file);
|
||||||
echo "<h2>" . $path_parts['filename'] . "</h2>";
|
echo "<h2>" . $path_parts['filename'] . "</h2>";
|
||||||
echo "\n";
|
echo "\n";
|
||||||
echo $urlHighlight->highlightUrls(file_get_contents($file));
|
echo $urlHighlight->highlightUrls(file_get_contents($file));
|
||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
|
||||||
// Remove fclose($out); as $out is not defined
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// Remove fclose($out); as $out is not defined
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
Loading…
Reference in New Issue