cache_warmup icon indicating copy to clipboard operation
cache_warmup copied to clipboard

Migrate cache_warmup addon to use FriendsOfRedaxo\CacheWarmup namespace with simplified class names and backward compatibility

Open Copilot opened this issue 6 months ago • 5 comments

This PR migrates the cache_warmup addon to use the proper namespace FriendsOfRedaxo\CacheWarmup and converts all class names to follow PSR-1 naming conventions with a simplified structure.

Changes Made

Namespace Migration & Simplification:

  • Added namespace FriendsOfRedaxo\CacheWarmup; declaration to all classes in the lib/ directory
  • Simplified class names by removing the CacheWarmup prefix:
    • cache_warmup_generatorGenerator
    • cache_warmup_generator_imagesGeneratorImages
    • cache_warmup_generator_pagesGeneratorPages
    • cache_warmup_selectorSelector
    • cache_warmup_writerWriter

Backward Compatibility:

  • Created deprecated wrapper classes in lib/deprecated/ that extend the new namespaced classes
  • All old class names remain functional until the next major release
  • Added proper @deprecated annotations with migration guidance

Updated References:

  • Updated use statements in page files (pages/generator.php, pages/warmup.php)
  • Class inheritance relationships updated to use new simplified names
  • Class instantiation and static method calls updated in page files

Migration Documentation:

  • Added comprehensive migration guide to README.md
  • Included code examples showing old vs new usage patterns
  • Documented all class name changes and namespace structure

Implementation Notes

  • Method names were already correctly following camelCase convention
  • External REDAXO framework classes (rex_*) remain unchanged
  • String identifiers (CSRF token names, CSS classes, translation keys) preserved
  • All PHP files pass syntax validation
  • Deprecated classes properly include parent classes for immediate usability
  • Maintains full backward compatibility through proper namespace usage and wrapper classes

Fixes #120.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Aug 05 '25 21:08 Copilot