Files
Malin 37cf714058 WebP Express CloudHost.es Fix v0.25.9-cloudhost
 Fixed bulk conversion getting stuck on missing files
 Added robust error handling and timeout protection
 Improved JavaScript response parsing
 Added file existence validation
 Fixed missing PHP class imports
 Added comprehensive try-catch error recovery

🔧 Key fixes:
- File existence checks before conversion attempts
- 30-second timeout protection per file
- Graceful handling of 500 errors and JSON parsing issues
- Automatic continuation to next file on failures
- Cache busting for JavaScript updates

🎯 Result: Bulk conversion now completes successfully even with missing files

🚀 Generated with Claude Code (https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 10:22:32 +02:00

1.3 KiB

More examples of what you can test:


require 'vendor/autoload.php';
use HtaccessCapabilityTester\HtaccessCapabilityTester;

$hct = new HtaccessCapabilityTester($baseDir, $baseUrl);

$rulesToCrashTest = <<<'EOD'
<ifModule mod_rewrite.c>
  RewriteEngine On
</ifModule>
EOD;
if ($hct->crashTest($rulesToCrashTest)) {
    // The rules at least did not cause requests to anything in the folder to "crash".
    // (even simple rules like the above can make the server respond with a
    //  500 Internal Server Error - see "docs/TheManyWaysOfHtaccessFailure.md")
}

if ($hct->addTypeWorks()) {
    // AddType directive works
}

if ($hct->headerSetWorks()) {
    // "Header set" works
}
if ($hct->requestHeaderWorks()) {
    // "RequestHeader set" works
}

// Note that the tests returns null if they are inconclusive
$testResult = $hct->htaccessEnabled();
if (is_null($testResult)) {
    // Inconclusive!
    // Perhaps a 403 Forbidden?
    // You can get a bit textual insight by using:
    // $hct->infoFromLastTest
}

// Also note that an exception will be thrown if test files cannot be created.
// You might want to wrap your call in a try-catch statement.
try {
    if ($hct->requestHeaderWorks()) {
        // "RequestHeader set" works
    }

} catch (\Exception $e) {
    // Probably permission problems.
    // We should probably notify someone
}