repair the repair

This commit is contained in:
Nils 2023-12-10 19:50:53 +01:00
parent 095136c5df
commit 6742e702ee
1 changed files with 26 additions and 21 deletions

View File

@ -11,15 +11,22 @@ $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; require $autoloadPath;
// Check if UrlHighlight class exists // Check if UrlHighlight class exists using its fully qualified name
if (!class_exists(\VStelmakh\UrlHighlight\UrlHighlight::class)) { 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 }
// Now we can use the use statement
use VStelmakh\UrlHighlight\UrlHighlight; use VStelmakh\UrlHighlight\UrlHighlight;
// Main logic of the script starts here
$urlHighlight = new UrlHighlight(); $urlHighlight = new UrlHighlight();
$files = glob("./protokolle/osamc_*.txt"); $files = glob("./protokolle/osamc_*.txt");
@ -31,8 +38,6 @@ if (!file_exists($autoloadPath)) {
echo "\n"; echo "\n";
} }
// Remove fclose($out); as $out is not defined // Remove fclose($out); as $out is not defined
}
}
?> ?>
</pre> </pre>