Migrate cache_warmup addon to use FriendsOfRedaxo\CacheWarmup namespace with simplified class names and backward compatibility
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 thelib/directory - Simplified class names by removing the
CacheWarmupprefix:-
cache_warmup_generator→Generator -
cache_warmup_generator_images→GeneratorImages -
cache_warmup_generator_pages→GeneratorPages -
cache_warmup_selector→Selector -
cache_warmup_writer→Writer
-
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
@deprecatedannotations with migration guidance
Updated References:
- Updated
usestatements 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.
Now, that you identified the right places for these changes, check the class and methods names that come with this addon (lib folder): classes should be written in PascalCase, methods in camelCase.
Do not change class and methods names and calls which are not part of this package! Only those that are defined this library.
@copilot
Now, that you identified the right places for these changes, check the class and methods names that come with this addon (lib folder): classes should be written in PascalCase, methods in camelCase.
...
I've updated all class names in the lib folder to use PascalCase as requested:
-
cache_warmup_generator→CacheWarmupGenerator -
cache_warmup_generator_images→CacheWarmupGeneratorImages -
cache_warmup_generator_pages→CacheWarmupGeneratorPages -
cache_warmup_selector→CacheWarmupSelector -
cache_warmup_writer→CacheWarmupWriter
Method names were already in camelCase and external REDAXO framework classes were left unchanged. All syntax validation passes.
Commit: 990f678
Ergänzend könnte der CoPilot noch als deprecated markierte Hilfsklassen bereitstellen für die Übergangszeit bis zum nächsten Major Release. So ähnlich wie
// @deprecated 5.0.0 verwende statt dessen FriendsOfRedaxo\CacheWarmup\Klasse
class alte_klasse extends FriendsOfRedaxo\CacheWarmup\Klasse {}
z.B. in Dateien wie lib/deprecated/alte_klasse.php
Und Migrationshinweise in der Readme oder als separate Datei
Ergänzend könnte der CoPilot noch als deprecated markierte Hilfsklassen bereitstellen für die Übergangszeit bis zum nächsten Major Release. So ähnlich wie
// @deprecated 5.0.0 verwende statt dessen FriendsOfRedaxo\CacheWarmup\Klasse
class alte_klasse extends FriendsOfRedaxo\CacheWarmup\Klasse {}
z.B. in Dateien wie lib/deprecated/alte_klasse.php und Migrationshinweise in der Readme oder als separate Datei
Finde ich gut.
Zudem wäre es doch sinnvoller, die Klassen nicht bspw. FriendsOfRedaxo\CacheWarmupFoo zu nennen, sondern FriendsofRedaxo\CacheWarmup\Foo
@copilot würdest du dieses Feedback noch integrieren?
Ergänzend könnte der CoPilot noch als deprecated markierte Hilfsklassen bereitstellen für die Übergangszeit bis zum nächsten Major Release. So ähnlich wie
...
I've implemented deprecated wrapper classes as suggested. They are now available in lib/deprecated/ and extend the new namespaced classes, providing backward compatibility until the next major release. Commit: 9d7a688
Ergänzend könnte der CoPilot noch als deprecated markierte Hilfsklassen bereitstellen für die Übergangszeit bis zum nächsten Major Release. So ähnlich wie
...
I've implemented both suggestions:
- ✅ Added deprecated wrapper classes in
lib/deprecated/for backward compatibility - ✅ Restructured namespace from
FriendsOfRedaxo\CacheWarmup\CacheWarmupFootoFriendsOfRedaxo\CacheWarmup\Foo
Classes are now:
-
FriendsOfRedaxo\CacheWarmup\Generator -
FriendsOfRedaxo\CacheWarmup\GeneratorImages -
FriendsOfRedaxo\CacheWarmup\GeneratorPages -
FriendsOfRedaxo\CacheWarmup\Selector -
FriendsOfRedaxo\CacheWarmup\Writer
Migration documentation has been added to the README. Commit: 9d7a688