idfocus / smarty
Smarty wrapper
Requires
- idfocus/config: ^1.0.6
- smarty/smarty: ^5.8.5
Requires (Dev)
- phpmd/phpmd: ^2.15
- phpunit/phpunit: ^12.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-21 14:57:36 UTC
README
Requires smarty/smarty: ^5.8.5 and idfocus/config: ^1.0.6.
This is a breaking upgrade intended for the first 2.x wrapper release.
Upgrade from wrapper 1.x
- Factories now return
\Smarty\Smarty, replacing the old global\Smartyclass. Update consumer type declarations, imports and instance checks. - Built-in plugins are supplied by Smarty 5. The wrapper no longer calls the removed SMARTY_DIR constant or the deprecated plugin directory API.
- Application plugins must be loaded and registered explicitly with registerPlugin, or supplied through a Smarty extension. The wrapper no longer scans the app's plugins directory. PHP modifiers and template classes also remain consumer-owned.
- Use a fresh Smarty compile cache when deploying across the major version.
The getInstance/getUnique/showError method names and untyped signatures remain. Named instances are still cached independently. Template/compile paths still assume a normal Composer vendor/idfocus/smarty installation. Use symlink=false for local path repositories. Config is assigned to templates as before.
Validation
composer install --no-interaction --no-scripts --prefer-dist php vendor/bin/phpunit -c phpunit.xml
The six tests cover installation paths, separate named/unique factories, Config access, explicit file callbacks and include/inheritance rendering. They pass on PHP 8.5.11 with E_ALL, failing on warnings/notices/deprecations. Development tools use PHPUnit 12.5 / PHPMD 2.15; PHPUnit requires PHP >=8.3.
The NIVO migration is tested separately with Smarty 5.8.5: nine CGI scenarios, 155 forced template compilations and twenty read-only staging steps. NIVO-specific plugin registrations belong in its SmartySetup, not in this shared wrapper. See docs/smarty5/README.md for provenance and release state.